chiark / gitweb /
manager: before entering loop dispatch queued up SIGCHLDs
[elogind.git] / src / main.c
index bba2975e467fea4112bc95a4ba7bd9ad6872310a..311ece6b57141cdf8be5cc1d4f1cbceea5f76342 100644 (file)
@@ -138,15 +138,10 @@ _noreturn static void crash(int sig) {
                 else if (pid == 0) {
                         int fd, r;
 
-                        if ((fd = acquire_terminal("/dev/console", false, true)) < 0) {
+                        if ((fd = acquire_terminal("/dev/console", false, true, true)) < 0)
                                 log_error("Failed to acquire terminal: %s", strerror(-fd));
-                                _exit(1);
-                        }
-
-                        if ((r = make_stdio(fd)) < 0) {
+                        else if ((r = make_stdio(fd)) < 0)
                                 log_error("Failed to duplicate terminal fd: %s", strerror(-r));
-                                _exit(1);
-                        }
 
                         execl("/bin/sh", "/bin/sh", NULL);