summaryrefslogtreecommitdiffstats
path: root/sbin/init/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/init/init.c')
-rw-r--r--sbin/init/init.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 393955f..eb0569a 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1066,6 +1066,7 @@ start_window_system(session_t *sp)
pid_t pid;
sigset_t mask;
char term[64], *env[2];
+ int status;
if ((pid = fork()) == -1) {
emergency("can't fork for window system on port %s: %m",
@@ -1073,9 +1074,20 @@ start_window_system(session_t *sp)
/* hope that getty fails and we can try again */
return;
}
-
if (pid)
+ {
+ waitpid(-1, &status, 0);
return;
+ }
+
+ /* reparent window process to the init to not make a zombie on exit */
+ if ((pid = fork()) == -1) {
+ emergency("can't fork for window system on port %s: %m",
+ sp->se_device);
+ _exit(1);
+ }
+ if (pid)
+ _exit(0);
sigemptyset(&mask);
sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0);
OpenPOWER on IntegriCloud