From: 2xsec Date: Tue, 23 Oct 2018 02:38:29 +0000 (+0900) Subject: storage_utils: use _exit() instead of exit() in child process X-Git-Tag: lxc-3.1.0~28^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0b0c44b72c4aea396ea8da638d1ca46a4bada67;p=thirdparty%2Flxc.git storage_utils: use _exit() instead of exit() in child process Signed-off-by: 2xsec --- diff --git a/src/lxc/storage/storage_utils.c b/src/lxc/storage/storage_utils.c index ca5959259..fa4e7270b 100644 --- a/src/lxc/storage/storage_utils.c +++ b/src/lxc/storage/storage_utils.c @@ -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)