lxccontainer: do_lxcapi_start()

thread-safety: s/exit()/_exit()/g Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 9994d140
...@@ -903,14 +903,14 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -903,14 +903,14 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
pid = fork(); pid = fork();
if (pid < 0) { if (pid < 0) {
SYSERROR("Failed to fork first child process"); SYSERROR("Failed to fork first child process");
exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
} }
/* second parent */ /* second parent */
if (pid != 0) { if (pid != 0) {
free_init_cmd(init_cmd); free_init_cmd(init_cmd);
lxc_free_handler(handler); lxc_free_handler(handler);
exit(EXIT_SUCCESS); _exit(EXIT_SUCCESS);
} }
/* second child */ /* second child */
...@@ -919,7 +919,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -919,7 +919,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
ret = chdir("/"); ret = chdir("/");
if (ret < 0) { if (ret < 0) {
SYSERROR("Failed to change to \"/\" directory"); SYSERROR("Failed to change to \"/\" directory");
exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
} }
keepfds[0] = handler->conf->maincmd_fd; keepfds[0] = handler->conf->maincmd_fd;
...@@ -928,13 +928,13 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -928,13 +928,13 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
ret = lxc_check_inherited(conf, true, keepfds, ret = lxc_check_inherited(conf, true, keepfds,
sizeof(keepfds) / sizeof(keepfds[0])); sizeof(keepfds) / sizeof(keepfds[0]));
if (ret < 0) if (ret < 0)
exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
/* redirect std{in,out,err} to /dev/null */ /* redirect std{in,out,err} to /dev/null */
ret = null_stdfds(); ret = null_stdfds();
if (ret < 0) { if (ret < 0) {
ERROR("Failed to redirect std{in,out,err} to /dev/null"); ERROR("Failed to redirect std{in,out,err} to /dev/null");
exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
} }
/* become session leader */ /* become session leader */
...@@ -961,7 +961,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -961,7 +961,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
free_init_cmd(init_cmd); free_init_cmd(init_cmd);
lxc_free_handler(handler); lxc_free_handler(handler);
if (daemonize) if (daemonize)
exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
return false; return false;
} }
...@@ -972,7 +972,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -972,7 +972,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
free_init_cmd(init_cmd); free_init_cmd(init_cmd);
lxc_free_handler(handler); lxc_free_handler(handler);
if (daemonize) if (daemonize)
exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
return false; return false;
} }
...@@ -1043,9 +1043,9 @@ on_error: ...@@ -1043,9 +1043,9 @@ on_error:
free_init_cmd(init_cmd); free_init_cmd(init_cmd);
if (daemonize && ret != 0) if (daemonize && ret != 0)
exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
else if (daemonize) else if (daemonize)
exit(EXIT_SUCCESS); _exit(EXIT_SUCCESS);
if (ret != 0) if (ret != 0)
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment