]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
remove redundant, too-early call to clearenv in api_start call.
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 19 Feb 2013 20:39:31 +0000 (14:39 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 19 Feb 2013 20:47:50 +0000 (15:47 -0500)
Ok, took a look, what happened was the clearenv calls used to be
in lxc_start and lxccontainer and lxc_execute (do lxc_start() callers)
themselves.  I moved those into do_start(), but the calls in
lxccontainer.c were never removed.

They should simply be removed altogether.  Trivial patch follows.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxccontainer.c

index f24c39f180297404630a2fd0ae8234aeb0c391c7..bcfc8b61a2f89b23d109fec5c70e36b98408b235 100644 (file)
@@ -369,21 +369,6 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, char * const argv
                setsid();
        }
 
-       if (clearenv()) {
-               SYSERROR("failed to clear environment");
-               /* don't error out though */
-       }
-
-       if (putenv("container=lxc")) {
-               fprintf(stderr, "failed to set environment variable");
-               if (daemonize) {
-                       lxc_container_put(c);
-                       exit(1);
-               } else {
-                       return false;
-               }
-       }
-
 reboot:
        conf->reboot = 0;
        ret = lxc_start(c->name, argv, conf, c->config_path);