Skip to content

Commit ff61214

Browse files
committed
[PR #1402] dix: drop DE_RESET and associated cmdline args
PR: #1402
1 parent a115c71 commit ff61214

File tree

15 files changed

+17
-76
lines changed

15 files changed

+17
-76
lines changed

dix/dispatch.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ Dispatch(void)
595595
}
596596
ddxBeforeReset();
597597
KillAllClients();
598-
dispatchException &= ~DE_RESET;
599598
SmartScheduleLatencyLimited = 0;
600599
ResetOsBuffers();
601600
}
@@ -3604,7 +3603,7 @@ ProcNoOperation(ClientPtr client)
36043603
* then killed again, the client is really destroyed.
36053604
*********************/
36063605

3607-
char dispatchExceptionAtReset = DE_RESET;
3606+
char dispatchExceptionAtReset = 0;
36083607
int terminateDelay = 0;
36093608

36103609
void

dix/dix_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ extern Bool whiteRoot;
282282
extern volatile char isItTimeToYield;
283283

284284
/* bit values for dispatchException */
285-
#define DE_RESET 1
286285
#define DE_TERMINATE 2
287286
#define DE_PRIORITYCHANGE 4 /* set when a client's priority changes */
288287

dix/globals.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ int currentMaxClients; /* current size of clients array */
8686
long maxBigRequestSize = MAX_BIG_REQUEST_SIZE;
8787

8888
unsigned long globalSerialNumber = 0;
89-
x_server_generation_t serverGeneration = 0;
89+
90+
/* this is always 1 now, since there's no internal reset anymore */
91+
x_server_generation_t serverGeneration = 1;
9092

9193
/* these next four are initialized in main.c */
9294
CARD32 ScreenSaverTime;

dix/main.c

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ dix_main(int argc, char *argv[], char *envp[])
147147

148148
alwaysCheckForInput[0] = 0;
149149
alwaysCheckForInput[1] = 1;
150-
while (1) {
151-
serverGeneration++;
150+
152151
ScreenSaverTime = defaultScreenSaverTime;
153152
ScreenSaverInterval = defaultScreenSaverInterval;
154153
ScreenSaverBlanking = defaultScreenSaverBlanking;
@@ -157,17 +156,15 @@ dix_main(int argc, char *argv[], char *envp[])
157156
InitBlockAndWakeupHandlers();
158157
/* Perform any operating system dependent initializations you'd like */
159158
OsInit();
160-
if (serverGeneration == 1) {
159+
161160
CreateWellKnownSockets();
162161
for (int i = 1; i < LimitClients; i++)
163162
clients[i] = NULL;
164163
serverClient = calloc(1, sizeof(ClientRec));
165164
if (!serverClient)
166165
FatalError("couldn't create server client");
167166
InitClient(serverClient, 0, (void *) NULL);
168-
}
169-
else
170-
ResetWellKnownSockets();
167+
171168
clients[0] = serverClient;
172169
currentMaxClients = 1;
173170

@@ -352,19 +349,13 @@ dix_main(int argc, char *argv[], char *envp[])
352349

353350
ClearWorkQueue();
354351

355-
if (dispatchException & DE_TERMINATE) {
356-
CloseWellKnownConnections();
357-
}
358-
359-
OsCleanup((dispatchException & DE_TERMINATE) != 0);
352+
CloseWellKnownConnections();
353+
OsCleanup(TRUE);
360354

361-
if (dispatchException & DE_TERMINATE) {
362-
ddxGiveUp(EXIT_NO_ERROR);
363-
break;
364-
}
355+
ddxGiveUp(EXIT_NO_ERROR);
365356

366357
free(ConnectionInfo);
367358
ConnectionInfo = NULL;
368-
}
359+
369360
return 0;
370361
}

man/Xserver.man

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ with
241241
This option may be issued multiple times to enable listening to different
242242
transport types.
243243
.TP 8
244-
.B \-noreset
245-
prevents a server reset when the last client connection is closed. This
246-
overrides a previous
247244
.B \-terminate
248245
command line option.
249246
.TP 8
@@ -393,10 +390,6 @@ has multiple network interfaces). The \fIlocal-address\fP may be expressed
393390
in any form acceptable to the host platform's \fIgethostbyname\fP(3)
394391
implementation.
395392
.TP 8
396-
.B \-once
397-
causes the server to terminate (rather than reset) when the XDMCP session
398-
ends.
399-
.TP 8
400393
.B \-class \fIdisplay-class\fP
401394
XDMCP has an additional display qualifier used in resource lookup for
402395
display-specific options. This option sets that value, by default it

os/connection.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ CreateWellKnownSockets(void)
297297

298298
#if !defined(WIN32)
299299
OsSignal(SIGPIPE, SIG_IGN);
300-
OsSignal(SIGHUP, AutoResetServer);
301300
#endif
302301
OsSignal(SIGINT, GiveUp);
303302
OsSignal(SIGTERM, GiveUp);

os/osdep.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ int Pclose(void *f);
135135

136136
#endif /* WIN32 */
137137

138-
void AutoResetServer(int sig);
139-
140138
/* clone fd so it gets out of our select mask */
141139
int os_move_fd(int fd);
142140

os/utils.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,6 @@ OsSignal(int sig, OsSigHandlerPtr handler)
160160
#endif
161161
}
162162

163-
/* Force connections to close on SIGHUP from init */
164-
165-
void
166-
AutoResetServer(int sig)
167-
{
168-
int olderrno = errno;
169-
170-
dispatchException |= DE_RESET;
171-
isItTimeToYield = TRUE;
172-
errno = olderrno;
173-
}
174-
175163
/* Force connections to close and then exit on SIGTERM, SIGINT */
176164

177165
void
@@ -305,9 +293,7 @@ UseMsg(void)
305293
ErrorF("-maxclients n set maximum number of clients (power of two)\n");
306294
ErrorF("-nolisten string don't listen on protocol\n");
307295
ErrorF("-listen string listen on protocol\n");
308-
ErrorF("-noreset don't reset after last client exists\n");
309296
ErrorF("-background [none] create root window with no background\n");
310-
ErrorF("-reset reset after last client exists\n");
311297
ErrorF("-p # screen-saver pattern duration (minutes)\n");
312298
ErrorF("-pn accept failure to listen on all ports\n");
313299
ErrorF("-nopn reject failure to listen on all ports\n");
@@ -614,12 +600,6 @@ ProcessCommandLine(int argc, char *argv[])
614600
else
615601
UseMsg();
616602
}
617-
else if (strcmp(argv[i], "-noreset") == 0) {
618-
dispatchExceptionAtReset = 0;
619-
}
620-
else if (strcmp(argv[i], "-reset") == 0) {
621-
dispatchExceptionAtReset = DE_RESET;
622-
}
623603
else if (strcmp(argv[i], "-p") == 0) {
624604
if (++i < argc)
625605
defaultScreenSaverInterval = ((CARD32) atoi(argv[i])) *

os/xdmcp.c

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ XdmcpRegisterManufacturerDisplayID(const char *name, int length)
213213
}
214214

215215
static unsigned short xdm_udp_port = XDM_UDP_PORT;
216-
static Bool OneSession = FALSE;
217216
static const char *xdm_from = NULL;
218217

219218
void
@@ -228,7 +227,6 @@ XdmcpUseMsg(void)
228227
ErrorF("-port port-num UDP port number to send messages to\n");
229228
ErrorF
230229
("-from local-address specify the local address to connect from\n");
231-
ErrorF("-once Terminate server after one session\n");
232230
ErrorF("-class display-class specify display class to send in manage\n");
233231
#ifdef HASXDMAUTH
234232
ErrorF("-cookie xdm-auth-bits specify the magic cookie for XDMCP\n");
@@ -287,10 +285,6 @@ XdmcpOptions(int argc, char **argv, int i)
287285
get_fromaddr_by_name(argc, argv, ++i);
288286
return i + 1;
289287
}
290-
if (strcmp(argv[i], "-once") == 0) {
291-
OneSession = TRUE;
292-
return i + 1;
293-
}
294288
if (strcmp(argv[i], "-class") == 0) {
295289
if (++i == argc) {
296290
FatalError("Xserver: missing class name in command line\n");
@@ -644,10 +638,7 @@ XdmcpCloseDisplay(int sock)
644638
|| sessionSocket != sock)
645639
return;
646640
state = XDM_INIT_STATE;
647-
if (OneSession)
648-
dispatchException |= DE_TERMINATE;
649-
else
650-
dispatchException |= DE_RESET;
641+
dispatchException |= DE_TERMINATE;
651642
isItTimeToYield = TRUE;
652643
}
653644

@@ -804,7 +795,7 @@ XdmcpDeadSession(const char *reason)
804795
ErrorF("XDM: %s, declaring session dead\n", reason);
805796
state = XDM_INIT_STATE;
806797
isItTimeToYield = TRUE;
807-
dispatchException |= (OneSession ? DE_TERMINATE : DE_RESET);
798+
dispatchException |= DE_TERMINATE;
808799
TimerCancel(xdmcp_timer);
809800
timeOutRtx = 0;
810801
send_packet();
@@ -823,14 +814,8 @@ timeout(void)
823814
return;
824815
}
825816
else if (timeOutRtx >= XDM_RTX_LIMIT) {
826-
/* Quit if "-once" specified, otherwise reset and try again. */
827-
if (OneSession) {
828-
dispatchException |= DE_TERMINATE;
829-
ErrorF("XDM: too many retransmissions\n");
830-
}
831-
else {
832-
XdmcpDeadSession("too many retransmissions");
833-
}
817+
dispatchException |= DE_TERMINATE;
818+
ErrorF("XDM: too many retransmissions\n");
834819
return;
835820
}
836821

randr/rrproperty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
5656
static void
5757
RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event)
5858
{
59-
if (!(dispatchException & (DE_RESET | DE_TERMINATE)))
59+
if (!(dispatchException & (DE_TERMINATE)))
6060
WalkTree(pScreen, DeliverPropertyEvent, event);
6161
}
6262

0 commit comments

Comments
 (0)