lxccontainer: non-functional changes

parent 7cea5905
...@@ -836,7 +836,6 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -836,7 +836,6 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
int ret; int ret;
struct lxc_handler *handler; struct lxc_handler *handler;
struct lxc_conf *conf; struct lxc_conf *conf;
bool daemonize = false;
char *default_args[] = { char *default_args[] = {
"/sbin/init", "/sbin/init",
NULL, NULL,
...@@ -873,10 +872,9 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -873,10 +872,9 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
return false; return false;
conf = c->lxc_conf; conf = c->lxc_conf;
daemonize = c->daemonize;
/* initialize handler */ /* initialize handler */
handler = lxc_init_handler(c->name, conf, c->config_path, daemonize); handler = lxc_init_handler(c->name, conf, c->config_path, c->daemonize);
container_mem_unlock(c); container_mem_unlock(c);
if (!handler) if (!handler)
...@@ -903,7 +901,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -903,7 +901,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
* here to protect the on disk container? We don't want to exclude * here to protect the on disk container? We don't want to exclude
* things like lxc_info while the container is running. * things like lxc_info while the container is running.
*/ */
if (daemonize) { if (c->daemonize) {
bool started; bool started;
char title[2048]; char title[2048];
pid_t pid; pid_t pid;
...@@ -1010,7 +1008,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -1010,7 +1008,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
SYSERROR("Failed to write monitor pid to \"%s\"", c->pidfile); SYSERROR("Failed to write monitor pid to \"%s\"", c->pidfile);
if (daemonize) if (c->daemonize)
_exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
return false; return false;
...@@ -1023,7 +1021,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -1023,7 +1021,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
SYSERROR("Failed to write '%s'", c->pidfile); SYSERROR("Failed to write '%s'", c->pidfile);
if (daemonize) if (c->daemonize)
_exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
return false; return false;
...@@ -1054,7 +1052,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -1054,7 +1052,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
reboot: reboot:
if (conf->reboot == 2) { if (conf->reboot == 2) {
/* initialize handler */ /* initialize handler */
handler = lxc_init_handler(c->name, conf, c->config_path, daemonize); handler = lxc_init_handler(c->name, conf, c->config_path, c->daemonize);
if (!handler) { if (!handler) {
ret = 1; ret = 1;
goto on_error; goto on_error;
...@@ -1064,7 +1062,7 @@ reboot: ...@@ -1064,7 +1062,7 @@ reboot:
keepfds[0] = handler->conf->maincmd_fd; keepfds[0] = handler->conf->maincmd_fd;
keepfds[1] = handler->state_socket_pair[0]; keepfds[1] = handler->state_socket_pair[0];
keepfds[2] = handler->state_socket_pair[1]; keepfds[2] = handler->state_socket_pair[1];
ret = lxc_check_inherited(conf, daemonize, keepfds, ret = lxc_check_inherited(conf, c->daemonize, keepfds,
sizeof(keepfds) / sizeof(keepfds[0])); sizeof(keepfds) / sizeof(keepfds[0]));
if (ret < 0) { if (ret < 0) {
lxc_free_handler(handler); lxc_free_handler(handler);
...@@ -1073,9 +1071,11 @@ reboot: ...@@ -1073,9 +1071,11 @@ reboot:
} }
if (useinit) if (useinit)
ret = lxc_execute(c->name, argv, 1, handler, c->config_path, daemonize, &c->error_num); ret = lxc_execute(c->name, argv, 1, handler, c->config_path,
c->daemonize, &c->error_num);
else else
ret = lxc_start(c->name, argv, handler, c->config_path, daemonize, &c->error_num); ret = lxc_start(c->name, argv, handler, c->config_path,
c->daemonize, &c->error_num);
if (conf->reboot == 1) { if (conf->reboot == 1) {
INFO("Container requested reboot"); INFO("Container requested reboot");
...@@ -1091,9 +1091,9 @@ on_error: ...@@ -1091,9 +1091,9 @@ on_error:
} }
free_init_cmd(init_cmd); free_init_cmd(init_cmd);
if (daemonize && ret != 0) if (c->daemonize && ret != 0)
_exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
else if (daemonize) else if (c->daemonize)
_exit(EXIT_SUCCESS); _exit(EXIT_SUCCESS);
if (ret != 0) if (ret != 0)
......
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