From: Christian Brauner Date: Fri, 23 Feb 2018 13:30:55 +0000 (+0100) Subject: utils: lxc_popen() X-Git-Tag: lxc-3.0.0.beta1~15^2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03f618afc338163801703f8561264d3abc46958e;p=thirdparty%2Flxc.git utils: lxc_popen() thread-safety: s/exit()/_exit()/g Signed-off-by: Christian Brauner --- diff --git a/src/lxc/utils.c b/src/lxc/utils.c index c824e9b99..98b4655cf 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -478,7 +478,7 @@ struct lxc_popen_FILE *lxc_popen(const char *command) ret = fcntl(pipe_fds[1], F_SETFD, 0); if (ret < 0) { close(pipe_fds[1]); - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); } /* duplicate stderr */ @@ -488,19 +488,19 @@ struct lxc_popen_FILE *lxc_popen(const char *command) ret = fcntl(pipe_fds[1], F_SETFD, 0); close(pipe_fds[1]); if (ret < 0) - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); /* unblock all signals */ ret = sigfillset(&mask); if (ret < 0) - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); ret = sigprocmask(SIG_UNBLOCK, &mask, NULL); if (ret < 0) - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); execl("/bin/sh", "sh", "-c", command, (char *)NULL); - exit(127); + _exit(127); } close(pipe_fds[1]);