]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxccontainer: do_lxcapi_is_defined()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 24 Feb 2018 14:16:40 +0000 (15:16 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 23 Aug 2018 20:28:26 +0000 (22:28 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxccontainer.c

index 0262704e4164c820233326ae8c5d631e751d23e2..e4e7002e44514cd590675f919c375c5d239e9075 100644 (file)
@@ -349,24 +349,28 @@ int lxc_container_put(struct lxc_container *c)
 
 static bool do_lxcapi_is_defined(struct lxc_container *c)
 {
+       int statret;
        struct stat statbuf;
        bool ret = false;
-       int statret;
 
        if (!c)
                return false;
 
        if (container_mem_lock(c))
                return false;
+
        if (!c->configfile)
-               goto out;
+               goto on_error;
+
        statret = stat(c->configfile, &statbuf);
        if (statret != 0)
-               goto out;
+               goto on_error;
+
        ret = true;
 
-out:
+on_error:
        container_mem_unlock(c);
+
        return ret;
 }