]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
monitor: change exit() => _exit() system call in child process
author2xsec <dh48.jeong@samsung.com>
Fri, 22 Jun 2018 13:42:32 +0000 (22:42 +0900)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 10 Dec 2018 13:32:38 +0000 (14:32 +0100)
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/lxc/monitor.c

index 91c4b4ee95ed9dd8a873060c52c5e1aef17a615e..9c5da368055ccf6345be244f033491f02b3832b1 100644 (file)
@@ -331,13 +331,13 @@ int lxc_monitord_spawn(const char *lxcpath)
 
        if (pipe(pipefd) < 0) {
                SYSERROR("Failed to create pipe.");
-               exit(EXIT_FAILURE);
+               _exit(EXIT_FAILURE);
        }
 
        pid2 = fork();
        if (pid2 < 0) {
                SYSERROR("Failed to fork().");
-               exit(EXIT_FAILURE);
+               _exit(EXIT_FAILURE);
        }
 
        if (pid2) {
@@ -357,18 +357,18 @@ int lxc_monitord_spawn(const char *lxcpath)
                close(pipefd[0]);
 
                DEBUG("Successfully synced with child process.");
-               exit(EXIT_SUCCESS);
+               _exit(EXIT_SUCCESS);
        }
 
        if (setsid() < 0) {
                SYSERROR("Failed to setsid().");
-               exit(EXIT_FAILURE);
+               _exit(EXIT_FAILURE);
        }
 
        lxc_check_inherited(NULL, true, &pipefd[1], 1);
        if (null_stdfds() < 0) {
                SYSERROR("Failed to dup2() standard file descriptors to /dev/null.");
-               exit(EXIT_FAILURE);
+               _exit(EXIT_FAILURE);
        }
 
        close(pipefd[0]);
@@ -376,7 +376,7 @@ int lxc_monitord_spawn(const char *lxcpath)
        ret = snprintf(pipefd_str, LXC_NUMSTRLEN64, "%d", pipefd[1]);
        if (ret < 0 || ret >= LXC_NUMSTRLEN64) {
                ERROR("Failed to create pid argument to pass to monitord.");
-               exit(EXIT_FAILURE);
+               _exit(EXIT_FAILURE);
        }
 
        DEBUG("Using pipe file descriptor %d for monitord.", pipefd[1]);
@@ -384,5 +384,5 @@ int lxc_monitord_spawn(const char *lxcpath)
        execvp(args[0], args);
        SYSERROR("failed to exec lxc-monitord");
 
-       exit(EXIT_FAILURE);
+       _exit(EXIT_FAILURE);
 }