}
if (my_args.close_all_fds)
- conf->close_all_fds = 1;
+ c->want_close_all_fds(c);
err = c->start(c, 0, args) ? 0 : -1;
container_mem_unlock(c);
}
+static void lxcapi_want_close_all_fds(struct lxc_container *c)
+{
+ if (!c || !c->lxc_conf)
+ return;
+ if (container_mem_lock(c)) {
+ ERROR("Error getting mem lock");
+ return;
+ }
+ c->lxc_conf->close_all_fds = 1;
+ container_mem_unlock(c);
+}
+
static bool lxcapi_wait(struct lxc_container *c, const char *state, int timeout)
{
int ret;
c->init_pid = lxcapi_init_pid;
c->load_config = lxcapi_load_config;
c->want_daemonize = lxcapi_want_daemonize;
+ c->want_close_all_fds = lxcapi_want_close_all_fds;
c->start = lxcapi_start;
c->startl = lxcapi_startl;
c->stop = lxcapi_stop;
bool (*startl)(struct lxc_container *c, int useinit, ...);
bool (*stop)(struct lxc_container *c);
void (*want_daemonize)(struct lxc_container *c);
+ void (*want_close_all_fds)(struct lxc_container *c);
// Return current config file name. The result is strdup()d, so free the result.
char *(*config_file_name)(struct lxc_container *c);
// for wait, timeout == -1 means wait forever, timeout == 0 means don't wait.