summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:12 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:12 +0000
commitca56bbdb0d398371332467534deaefdb77883bd7 (patch)
treec2d0009eccfd0d8d2e7cae9932885a7a0a6699bc /server.c
parent19bd1c5e3910088ac0e92ca005427192a223c8a0 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'server.c')
-rw-r--r--server.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/server.c b/server.c
index 2ee5bba..d537ddc 100644
--- a/server.c
+++ b/server.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/xdm/server.c,v 3.13 2001/12/14 20:01:23 dawes Exp $ */
+/* $XFree86: xc/programs/xdm/server.c,v 3.14 2003/04/12 16:42:14 herrb Exp $ */
/*
* xdm - display manager daemon
@@ -190,14 +190,26 @@ serverPause (unsigned t, int serverPid)
#endif
for (;;) {
#if defined(SYSV) && defined(X_NOT_POSIX)
+ /*
+ * wait() is unsafe. Other Xserver or xdm processes may
+ * exit at this time and this will remove the wait status.
+ * This means the main loop will not restart the display.
+ */
pid = wait ((waitType *) 0);
#else
if (!receivedUsr1)
- pid = wait ((waitType *) 0);
- else
#ifndef X_NOT_POSIX
- pid = waitpid (-1, (int *) 0, WNOHANG);
+ pid = waitpid (serverPid, (int *) 0, 0);
+ else
+ pid = waitpid (serverPid, (int *) 0, WNOHANG);
#else
+ /*
+ * If you have wait4() but not waitpid(), use that instead
+ * of wait() and wait3() to make this code safe. See
+ * above comment.
+ */
+ pid = wait ((waitType *) 0);
+ else
pid = wait3 ((waitType *) 0, WNOHANG,
(struct rusage *) 0);
#endif /* X_NOT_POSIX */