]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevd: main - use _exit() when daemonizing
authorTom Gundersen <teg@jklm.no>
Mon, 18 May 2015 15:21:03 +0000 (17:21 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 18 May 2015 21:49:35 +0000 (23:49 +0200)
Makes it a bit clearer what is going on, rather than jumping to the end of main().

No functional change.

src/udev/udevd.c

index 4f43a6fe1212dface007a6e0fb99da29308fea93..19640cb6ea72125014aa4d625d8bed562c769036 100644 (file)
@@ -1507,7 +1507,9 @@ int main(int argc, char *argv[]) {
                         r = log_error_errno(errno, "fork of daemon failed: %m");
                         goto exit;
                 default:
-                        goto exit_daemonize;
+                        mac_selinux_finish();
+                        log_close();
+                        _exit(EXIT_SUCCESS);
                 }
 
                 setsid();
@@ -1697,7 +1699,6 @@ int main(int argc, char *argv[]) {
 exit:
         if (manager)
                 udev_ctrl_cleanup(manager->ctrl);
-exit_daemonize:
         mac_selinux_finish();
         log_close();
         return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;