Unverified Commit ea2a67a6 by Christian Brauner Committed by Stéphane Graber

lxccontainer: small cleanup to lxc_check_inherited() calls

parent cf52a093
...@@ -867,7 +867,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -867,7 +867,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
NULL, NULL,
}; };
char **init_cmd = NULL; char **init_cmd = NULL;
int keepfds[3] = {-1, -1, -1}; int keepfds[3] = {-EBADF, -EBADF, -EBADF};
/* container does exist */ /* container does exist */
if (!c) if (!c)
...@@ -1001,8 +1001,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a ...@@ -1001,8 +1001,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
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, true, keepfds, ret = lxc_check_inherited(conf, true, keepfds, ARRAY_SIZE(keepfds));
sizeof(keepfds) / sizeof(keepfds[0]));
if (ret < 0) if (ret < 0)
_exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
...@@ -1092,8 +1091,7 @@ reboot: ...@@ -1092,8 +1091,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, c->daemonize, keepfds, ret = lxc_check_inherited(conf, c->daemonize, keepfds, ARRAY_SIZE(keepfds));
sizeof(keepfds) / sizeof(keepfds[0]));
if (ret < 0) { if (ret < 0) {
lxc_free_handler(handler); lxc_free_handler(handler);
ret = 1; ret = 1;
......
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