From: Christian Brauner Date: Mon, 11 Dec 2017 05:22:56 +0000 (+0100) Subject: conf: fix lxc.prlimit clearing X-Git-Tag: lxc-3.0.0.beta1~123^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b668653c52132f76babe6d5bb10bda18348b4a9c;p=thirdparty%2Flxc.git conf: fix lxc.prlimit clearing Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 929d67c2c..aaed68297 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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; }