]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: fix lxc.prlimit clearing 2019/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 11 Dec 2017 05:22:56 +0000 (06:22 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 11 Dec 2017 05:22:56 +0000 (06:22 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 929d67c2c67bc5e1d8effd6600f05fea2f51ec9e..aaed682972637ad2650cce5a293b5bec015292ee 100644 (file)
@@ -3293,13 +3293,12 @@ int lxc_clear_limits(struct lxc_conf *c, const char *key)
        bool all = false;
        const char *k = NULL;
 
-       if (strcmp(key, "lxc.limit") == 0
-           || strcmp(key, "lxc.prlimit"))
+       if (strcmp(key, "lxc.limit") == 0 || strcmp(key, "lxc.prlimit") == 0)
                all = true;
-       else if (strncmp(key, "lxc.limit.", sizeof("lxc.limit.")-1) == 0)
-               k = key + sizeof("lxc.limit.")-1;
-       else if (strncmp(key, "lxc.prlimit.", sizeof("lxc.prlimit.")-1) == 0)
-               k = key + sizeof("lxc.prlimit.")-1;
+       else if (strncmp(key, "lxc.limit.", sizeof("lxc.limit.") - 1) == 0)
+               k = key + sizeof("lxc.limit.") - 1;
+       else if (strncmp(key, "lxc.prlimit.", sizeof("lxc.prlimit.") - 1) == 0)
+               k = key + sizeof("lxc.prlimit.") - 1;
        else
                return -1;
 
@@ -3312,6 +3311,7 @@ int lxc_clear_limits(struct lxc_conf *c, const char *key)
                free(lim);
                free(it);
        }
+
        return 0;
 }