]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Use autoconf LXCPATH instead of hardcoded LXCDIR
authorDwight Engen <dwight.engen@oracle.com>
Mon, 26 Nov 2012 20:57:53 +0000 (15:57 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 27 Nov 2012 15:07:51 +0000 (10:07 -0500)
LXCDIR is only used in lxc_container_new, whereas LXCPATH is used throughout
the rest of lxc, and even in the same file as lxc_container_new (for example
create_container_dir()).

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxccontainer.c
src/lxc/lxccontainer.h

index ed2c483022649212e26ee183e3d65bd642a348c6..cc91e055d7325d0065e05e523bedb564c6db4b93 100644 (file)
@@ -882,13 +882,13 @@ struct lxc_container *lxc_container_new(char *name)
                goto err;
        }
 
-       len = strlen(LXCDIR)+strlen(c->name)+strlen("/config")+2;
+       len = strlen(LXCPATH)+strlen(c->name)+strlen("/config")+2;
        c->configfile = malloc(len);
        if (!c->configfile) {
                fprintf(stderr, "Error allocating config file pathname\n");
                goto err;
        }
-       ret = snprintf(c->configfile, len, "%s/%s/config", LXCDIR, c->name);
+       ret = snprintf(c->configfile, len, "%s/%s/config", LXCPATH, c->name);
        if (ret < 0 || ret >= len) {
                fprintf(stderr, "Error printing out config file name\n");
                goto err;
@@ -928,7 +928,7 @@ struct lxc_container *lxc_container_new(char *name)
        }
 
        /*
-        * default configuration file is $LXCDIR/$NAME/config
+        * default configuration file is $LXCPATH/$NAME/config
         */
 
        return c;
index cad31ee982ca8fb864882390cec647600733a5c0..9e4267a56e80a0fc5c9e35f30e983e02dba67ec3 100644 (file)
@@ -18,7 +18,6 @@ struct lxc_container {
        int error_num;
        int daemonize;
 
-#define LXCDIR "/var/lib/lxc"
        bool (*is_defined)(struct lxc_container *c);  // did /var/lib/lxc/$name/config exist
        const char *(*state)(struct lxc_container *c);
        bool (*is_running)(struct lxc_container *c);  // true so long as defined and not stopped