]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Revert "set close-all-fds by default"
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 13 Jan 2015 05:06:01 +0000 (23:06 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 13 Jan 2015 05:06:01 +0000 (23:06 -0600)
it has unfortunate reprecussions elsewhere, and the needed fix
can be done another way

This reverts commit 1f76453a74f555e30384591567d87b5b4dac7e21.

src/lxc/lxccontainer.c

index 5bb6152c1cc78f6375ace6eaf7d0970b3f0f62f3..406cead1590f4be0f4cfc6fe06580b62f22b8b81 100644 (file)
@@ -457,14 +457,6 @@ static bool lxcapi_load_config(struct lxc_container *c, const char *alt_file)
        return ret;
 }
 
-static void do_set_daemonize(struct lxc_container *c, bool state)
-{
-       c->daemonize = state;
-       /* daemonize implies close_all_fds so set it */
-       if (state)
-               c->lxc_conf->close_all_fds = 1;
-}
-
 static bool lxcapi_want_daemonize(struct lxc_container *c, bool state)
 {
        if (!c || !c->lxc_conf)
@@ -473,7 +465,10 @@ static bool lxcapi_want_daemonize(struct lxc_container *c, bool state)
                ERROR("Error getting mem lock");
                return false;
        }
-       do_set_daemonize(c, state);
+       c->daemonize = state;
+       /* daemonize implies close_all_fds so set it */
+       if (state == 1)
+               c->lxc_conf->close_all_fds = 1;
        container_mem_unlock(c);
        return true;
 }
@@ -4103,9 +4098,7 @@ struct lxc_container *lxc_container_new(const char *name, const char *configpath
                container_destroy(c);
                lxcapi_clear_config(c);
        }
-       if (!c->lxc_conf)
-               c->lxc_conf = lxc_conf_init();
-       do_set_daemonize(c, true);
+       c->daemonize = true;
        c->pidfile = NULL;
 
        // assign the member functions