]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
storage_utils: use _exit() instead of exit() in child process
author2xsec <dh48.jeong@samsung.com>
Tue, 23 Oct 2018 02:38:29 +0000 (11:38 +0900)
committer2xsec <dh48.jeong@samsung.com>
Tue, 23 Oct 2018 10:01:23 +0000 (19:01 +0900)
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/lxc/storage/storage_utils.c

index ca595925998e2b0344374a868bcf81f43909e2c6..fa4e7270bd5378861c17e4ae908780600acf078a 100644 (file)
@@ -243,7 +243,7 @@ int detect_fs(struct lxc_storage *bdev, char *type, int len)
        }
 
        if (unshare(CLONE_NEWNS) < 0)
-               exit(1);
+               _exit(EXIT_FAILURE);
 
        if (detect_shared_rootfs())
                if (mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL)) {
@@ -255,21 +255,21 @@ int detect_fs(struct lxc_storage *bdev, char *type, int len)
        if (ret < 0) {
                ERROR("Failed to mount \"%s\" onto \"%s\" to detect FSType", srcdev,
                      bdev->dest);
-               exit(1);
+               _exit(EXIT_FAILURE);
        }
 
        l = linkderef(srcdev, devpath);
        if (!l)
-               exit(1);
+               _exit(EXIT_FAILURE);
 
        f = fopen("/proc/self/mounts", "r");
        if (!f)
-               exit(1);
+               _exit(EXIT_FAILURE);
 
        while (getline(&line, &linelen, f) != -1) {
                sp1 = strchr(line, ' ');
                if (!sp1)
-                       exit(1);
+                       _exit(EXIT_FAILURE);
 
                *sp1 = '\0';
                if (strcmp(line, l))
@@ -277,22 +277,22 @@ int detect_fs(struct lxc_storage *bdev, char *type, int len)
 
                sp2 = strchr(sp1 + 1, ' ');
                if (!sp2)
-                       exit(1);
+                       _exit(EXIT_FAILURE);
                *sp2 = '\0';
 
                sp3 = strchr(sp2 + 1, ' ');
                if (!sp3)
-                       exit(1);
+                       _exit(EXIT_FAILURE);
                *sp3 = '\0';
 
                sp2++;
                if (write(p[1], sp2, strlen(sp2)) != strlen(sp2))
-                       exit(1);
+                       _exit(EXIT_FAILURE);
 
-               exit(0);
+               _exit(EXIT_SUCCESS);
        }
 
-       exit(1);
+       _exit(EXIT_FAILURE);
 }
 
 int do_mkfs_exec_wrapper(void *args)