Skip to content

Commit

Permalink
utils: lxc_popen()
Browse files Browse the repository at this point in the history
thread-safety: s/exit()/_exit()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Aug 23, 2018
1 parent 1ba7d9b commit f7b5b0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lxc/utils.c
Expand Up @@ -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 */
Expand All @@ -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]);
Expand Down

0 comments on commit f7b5b0e

Please sign in to comment.