chiark / gitweb /
Do no isolate in case of emergency or severe problems
[elogind.git] / src / core / main.c
index 25f55fced23559addfaf0a54f932794c8175e033..35cd7724c30d926276538aebea07a4b079e1f515 100644 (file)
@@ -116,7 +116,8 @@ _noreturn_ static void crash(int sig) {
                 sa.sa_flags = SA_NOCLDSTOP|SA_RESTART;
                 assert_se(sigaction(SIGCHLD, &sa, NULL) == 0);
 
-                if ((pid = fork()) < 0)
+                pid = fork();
+                if (pid < 0)
                         log_error("Caught <%s>, cannot fork for core dump: %s", signal_to_string(sig), strerror(errno));
 
                 else if (pid == 0) {
@@ -147,7 +148,8 @@ _noreturn_ static void crash(int sig) {
                         int r;
 
                         /* Order things nicely. */
-                        if ((r = wait_for_terminate(pid, &status)) < 0)
+                        r = wait_for_terminate(pid, &status);
+                        if (r < 0)
                                 log_error("Caught <%s>, waitpid() failed: %s", signal_to_string(sig), strerror(-r));
                         else if (status.si_code != CLD_DUMPED)
                                 log_error("Caught <%s>, core dump failed.", signal_to_string(sig));