mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-23 23:30:02 +00:00
dix: drop DE_RESET and associated cmdline args
Drop the -reset flag, so Xserver now either simply continues (w/o going through internal reset) when last client disconnected or terminates when -terminate is given. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
45ff802682
commit
f27e12c918
@@ -595,7 +595,6 @@ Dispatch(void)
|
||||
}
|
||||
ddxBeforeReset();
|
||||
KillAllClients();
|
||||
dispatchException &= ~DE_RESET;
|
||||
SmartScheduleLatencyLimited = 0;
|
||||
ResetOsBuffers();
|
||||
}
|
||||
@@ -3604,7 +3603,7 @@ ProcNoOperation(ClientPtr client)
|
||||
* then killed again, the client is really destroyed.
|
||||
*********************/
|
||||
|
||||
char dispatchExceptionAtReset = DE_RESET;
|
||||
char dispatchExceptionAtReset = 0;
|
||||
int terminateDelay = 0;
|
||||
|
||||
void
|
||||
|
||||
@@ -282,7 +282,6 @@ extern Bool whiteRoot;
|
||||
extern volatile char isItTimeToYield;
|
||||
|
||||
/* bit values for dispatchException */
|
||||
#define DE_RESET 1
|
||||
#define DE_TERMINATE 2
|
||||
#define DE_PRIORITYCHANGE 4 /* set when a client's priority changes */
|
||||
|
||||
|
||||
@@ -86,7 +86,9 @@ int currentMaxClients; /* current size of clients array */
|
||||
long maxBigRequestSize = MAX_BIG_REQUEST_SIZE;
|
||||
|
||||
unsigned long globalSerialNumber = 0;
|
||||
x_server_generation_t serverGeneration = 0;
|
||||
|
||||
/* this is always 1 now, since there's no internal reset anymore */
|
||||
x_server_generation_t serverGeneration = 1;
|
||||
|
||||
/* these next four are initialized in main.c */
|
||||
CARD32 ScreenSaverTime;
|
||||
|
||||
23
dix/main.c
23
dix/main.c
@@ -147,8 +147,7 @@ dix_main(int argc, char *argv[], char *envp[])
|
||||
|
||||
alwaysCheckForInput[0] = 0;
|
||||
alwaysCheckForInput[1] = 1;
|
||||
while (1) {
|
||||
serverGeneration++;
|
||||
|
||||
ScreenSaverTime = defaultScreenSaverTime;
|
||||
ScreenSaverInterval = defaultScreenSaverInterval;
|
||||
ScreenSaverBlanking = defaultScreenSaverBlanking;
|
||||
@@ -157,7 +156,7 @@ dix_main(int argc, char *argv[], char *envp[])
|
||||
InitBlockAndWakeupHandlers();
|
||||
/* Perform any operating system dependent initializations you'd like */
|
||||
OsInit();
|
||||
if (serverGeneration == 1) {
|
||||
|
||||
CreateWellKnownSockets();
|
||||
for (int i = 1; i < LimitClients; i++)
|
||||
clients[i] = NULL;
|
||||
@@ -165,9 +164,7 @@ dix_main(int argc, char *argv[], char *envp[])
|
||||
if (!serverClient)
|
||||
FatalError("couldn't create server client");
|
||||
InitClient(serverClient, 0, (void *) NULL);
|
||||
}
|
||||
else
|
||||
ResetWellKnownSockets();
|
||||
|
||||
clients[0] = serverClient;
|
||||
currentMaxClients = 1;
|
||||
|
||||
@@ -352,19 +349,13 @@ dix_main(int argc, char *argv[], char *envp[])
|
||||
|
||||
ClearWorkQueue();
|
||||
|
||||
if (dispatchException & DE_TERMINATE) {
|
||||
CloseWellKnownConnections();
|
||||
}
|
||||
CloseWellKnownConnections();
|
||||
OsCleanup(TRUE);
|
||||
|
||||
OsCleanup((dispatchException & DE_TERMINATE) != 0);
|
||||
|
||||
if (dispatchException & DE_TERMINATE) {
|
||||
ddxGiveUp(EXIT_NO_ERROR);
|
||||
break;
|
||||
}
|
||||
ddxGiveUp(EXIT_NO_ERROR);
|
||||
|
||||
free(ConnectionInfo);
|
||||
ConnectionInfo = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -241,9 +241,6 @@ with
|
||||
This option may be issued multiple times to enable listening to different
|
||||
transport types.
|
||||
.TP 8
|
||||
.B \-noreset
|
||||
prevents a server reset when the last client connection is closed. This
|
||||
overrides a previous
|
||||
.B \-terminate
|
||||
command line option.
|
||||
.TP 8
|
||||
@@ -393,10 +390,6 @@ has multiple network interfaces). The \fIlocal-address\fP may be expressed
|
||||
in any form acceptable to the host platform's \fIgethostbyname\fP(3)
|
||||
implementation.
|
||||
.TP 8
|
||||
.B \-once
|
||||
causes the server to terminate (rather than reset) when the XDMCP session
|
||||
ends.
|
||||
.TP 8
|
||||
.B \-class \fIdisplay-class\fP
|
||||
XDMCP has an additional display qualifier used in resource lookup for
|
||||
display-specific options. This option sets that value, by default it
|
||||
|
||||
@@ -297,7 +297,6 @@ CreateWellKnownSockets(void)
|
||||
|
||||
#if !defined(WIN32)
|
||||
OsSignal(SIGPIPE, SIG_IGN);
|
||||
OsSignal(SIGHUP, AutoResetServer);
|
||||
#endif
|
||||
OsSignal(SIGINT, GiveUp);
|
||||
OsSignal(SIGTERM, GiveUp);
|
||||
|
||||
@@ -135,8 +135,6 @@ int Pclose(void *f);
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
void AutoResetServer(int sig);
|
||||
|
||||
/* clone fd so it gets out of our select mask */
|
||||
int os_move_fd(int fd);
|
||||
|
||||
|
||||
20
os/utils.c
20
os/utils.c
@@ -160,18 +160,6 @@ OsSignal(int sig, OsSigHandlerPtr handler)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Force connections to close on SIGHUP from init */
|
||||
|
||||
void
|
||||
AutoResetServer(int sig)
|
||||
{
|
||||
int olderrno = errno;
|
||||
|
||||
dispatchException |= DE_RESET;
|
||||
isItTimeToYield = TRUE;
|
||||
errno = olderrno;
|
||||
}
|
||||
|
||||
/* Force connections to close and then exit on SIGTERM, SIGINT */
|
||||
|
||||
void
|
||||
@@ -305,9 +293,7 @@ UseMsg(void)
|
||||
ErrorF("-maxclients n set maximum number of clients (power of two)\n");
|
||||
ErrorF("-nolisten string don't listen on protocol\n");
|
||||
ErrorF("-listen string listen on protocol\n");
|
||||
ErrorF("-noreset don't reset after last client exists\n");
|
||||
ErrorF("-background [none] create root window with no background\n");
|
||||
ErrorF("-reset reset after last client exists\n");
|
||||
ErrorF("-p # screen-saver pattern duration (minutes)\n");
|
||||
ErrorF("-pn accept failure to listen on all ports\n");
|
||||
ErrorF("-nopn reject failure to listen on all ports\n");
|
||||
@@ -614,12 +600,6 @@ ProcessCommandLine(int argc, char *argv[])
|
||||
else
|
||||
UseMsg();
|
||||
}
|
||||
else if (strcmp(argv[i], "-noreset") == 0) {
|
||||
dispatchExceptionAtReset = 0;
|
||||
}
|
||||
else if (strcmp(argv[i], "-reset") == 0) {
|
||||
dispatchExceptionAtReset = DE_RESET;
|
||||
}
|
||||
else if (strcmp(argv[i], "-p") == 0) {
|
||||
if (++i < argc)
|
||||
defaultScreenSaverInterval = ((CARD32) atoi(argv[i])) *
|
||||
|
||||
23
os/xdmcp.c
23
os/xdmcp.c
@@ -213,7 +213,6 @@ XdmcpRegisterManufacturerDisplayID(const char *name, int length)
|
||||
}
|
||||
|
||||
static unsigned short xdm_udp_port = XDM_UDP_PORT;
|
||||
static Bool OneSession = FALSE;
|
||||
static const char *xdm_from = NULL;
|
||||
|
||||
void
|
||||
@@ -228,7 +227,6 @@ XdmcpUseMsg(void)
|
||||
ErrorF("-port port-num UDP port number to send messages to\n");
|
||||
ErrorF
|
||||
("-from local-address specify the local address to connect from\n");
|
||||
ErrorF("-once Terminate server after one session\n");
|
||||
ErrorF("-class display-class specify display class to send in manage\n");
|
||||
#ifdef HASXDMAUTH
|
||||
ErrorF("-cookie xdm-auth-bits specify the magic cookie for XDMCP\n");
|
||||
@@ -287,10 +285,6 @@ XdmcpOptions(int argc, char **argv, int i)
|
||||
get_fromaddr_by_name(argc, argv, ++i);
|
||||
return i + 1;
|
||||
}
|
||||
if (strcmp(argv[i], "-once") == 0) {
|
||||
OneSession = TRUE;
|
||||
return i + 1;
|
||||
}
|
||||
if (strcmp(argv[i], "-class") == 0) {
|
||||
if (++i == argc) {
|
||||
FatalError("Xserver: missing class name in command line\n");
|
||||
@@ -644,10 +638,7 @@ XdmcpCloseDisplay(int sock)
|
||||
|| sessionSocket != sock)
|
||||
return;
|
||||
state = XDM_INIT_STATE;
|
||||
if (OneSession)
|
||||
dispatchException |= DE_TERMINATE;
|
||||
else
|
||||
dispatchException |= DE_RESET;
|
||||
dispatchException |= DE_TERMINATE;
|
||||
isItTimeToYield = TRUE;
|
||||
}
|
||||
|
||||
@@ -804,7 +795,7 @@ XdmcpDeadSession(const char *reason)
|
||||
ErrorF("XDM: %s, declaring session dead\n", reason);
|
||||
state = XDM_INIT_STATE;
|
||||
isItTimeToYield = TRUE;
|
||||
dispatchException |= (OneSession ? DE_TERMINATE : DE_RESET);
|
||||
dispatchException |= DE_TERMINATE;
|
||||
TimerCancel(xdmcp_timer);
|
||||
timeOutRtx = 0;
|
||||
send_packet();
|
||||
@@ -823,14 +814,8 @@ timeout(void)
|
||||
return;
|
||||
}
|
||||
else if (timeOutRtx >= XDM_RTX_LIMIT) {
|
||||
/* Quit if "-once" specified, otherwise reset and try again. */
|
||||
if (OneSession) {
|
||||
dispatchException |= DE_TERMINATE;
|
||||
ErrorF("XDM: too many retransmissions\n");
|
||||
}
|
||||
else {
|
||||
XdmcpDeadSession("too many retransmissions");
|
||||
}
|
||||
dispatchException |= DE_TERMINATE;
|
||||
ErrorF("XDM: too many retransmissions\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
|
||||
static void
|
||||
RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event)
|
||||
{
|
||||
if (!(dispatchException & (DE_RESET | DE_TERMINATE)))
|
||||
if (!(dispatchException & (DE_TERMINATE)))
|
||||
WalkTree(pScreen, DeliverPropertyEvent, event);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
|
||||
static void
|
||||
RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event)
|
||||
{
|
||||
if (!(dispatchException & (DE_RESET | DE_TERMINATE)))
|
||||
if (!(dispatchException & (DE_TERMINATE)))
|
||||
WalkTree(pScreen, DeliverPropertyEvent, event);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xephyr-glamor-gl
|
||||
export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/kdrive/ephyr/Xephyr \
|
||||
-glamor_gles2 \
|
||||
-glamor-skip-present \
|
||||
-noreset \
|
||||
-schedMax 2000 \
|
||||
-screen 1280x1024"
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xephyr-glamor-gl
|
||||
export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/kdrive/ephyr/Xephyr \
|
||||
-glamor_gles2 \
|
||||
-glamor-skip-present \
|
||||
-noreset \
|
||||
-schedMax 2000 \
|
||||
-screen 1280x1024"
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xephyr-glamor
|
||||
export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/kdrive/ephyr/Xephyr \
|
||||
-glamor \
|
||||
-glamor-skip-present \
|
||||
-noreset \
|
||||
-schedMax 2000 \
|
||||
-screen 1280x1024"
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
#fi
|
||||
|
||||
export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/vfb/Xvfb \
|
||||
-noreset \
|
||||
-screen scrn 1280x1024x24"
|
||||
export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xvfb
|
||||
|
||||
exec $XSERVER_DIR/test/scripts/run-piglit.sh
|
||||
|
||||
|
||||
Reference in New Issue
Block a user