diff options
author | George Lebl <jirka@5z.com> | 2001-09-11 08:42:49 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2001-09-11 08:42:49 +0000 |
commit | 8040cd1a80eed787c517544e2cc9c3b7b7e9dace (patch) | |
tree | 5268c1e8874cff33b4e5cd220d709d6402050b21 | |
parent | 7a93c245ef2116e925934ec4508f8c7d7546fad1 (diff) | |
download | gdm-8040cd1a80eed787c517544e2cc9c3b7b7e9dace.tar.gz |
use the safe fork function
Tue Sep 11 01:37:42 2001 George Lebl <jirka@5z.com>
* daemon/errorgui.c: use the safe fork function
* daemon/gdm.c: a doh kind of error, waitpid returns 0 to mean
'no child', not -1 as I assumed.
* gui/gdmflexiserver.c: another doh!, actually whack the screen
portion of the display number
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | daemon/errorgui.c | 3 | ||||
-rw-r--r-- | daemon/gdm.c | 2 | ||||
-rw-r--r-- | gui/gdmflexiserver.c | 6 |
4 files changed, 16 insertions, 5 deletions
@@ -1,3 +1,13 @@ +Tue Sep 11 01:37:42 2001 George Lebl <jirka@5z.com> + + * daemon/errorgui.c: use the safe fork function + + * daemon/gdm.c: a doh kind of error, waitpid returns 0 to mean + 'no child', not -1 as I assumed. + + * gui/gdmflexiserver.c: another doh!, actually whack the screen + portion of the display number + Mon Sep 10 20:20:59 2001 George Lebl <jirka@5z.com> * configure.in: raise version diff --git a/daemon/errorgui.c b/daemon/errorgui.c index d003f128..a4aeb03f 100644 --- a/daemon/errorgui.c +++ b/daemon/errorgui.c @@ -129,7 +129,8 @@ gdm_error_box (GdmDisplay *d, const char *dialog_type, const char *error) { pid_t pid; - extra_process = pid = fork (); + gdm_safe_fork (&extra_process); + pid = extra_process; if (pid == 0) { char *geom; int i; diff --git a/daemon/gdm.c b/daemon/gdm.c index f5a3f62e..677c9aa3 100644 --- a/daemon/gdm.c +++ b/daemon/gdm.c @@ -862,7 +862,7 @@ gdm_cleanup_children (void) /* Pid and exit status of slave that died */ pid = waitpid (-1, &exitstatus, WNOHANG); - if (pid < 0) + if (pid <= 0) return FALSE; if (WIFEXITED (exitstatus)) { diff --git a/gui/gdmflexiserver.c b/gui/gdmflexiserver.c index 3ae563ed..95410f4c 100644 --- a/gui/gdmflexiserver.c +++ b/gui/gdmflexiserver.c @@ -210,12 +210,12 @@ get_dispnum (void) while (*number == ':') { number++; } + p = strchr (number, '.'); + if (p != NULL) + *p = '\0'; } else { number = "0"; } - p = strchr (number, '.'); - if (p != NULL) - p = '\0'; } return number; |