]> 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>
Sat, 24 Feb 2018 20:38:13 +0000 (21:38 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxccontainer.c

index 1f6d33a6e3527ad7b5f84c75d23fd30de5f4c4fc..099746d613b2978dfea44f5a06f81d8428367333 100644 (file)
@@ -353,24 +353,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;
 }