]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: cleanup set_config_cgroup_relative()
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 8 Dec 2020 14:04:31 +0000 (15:04 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 8 Dec 2020 14:40:50 +0000 (15:40 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index f6fb3bd2765d9aad067e987b9f670076feb69f93..544c4913462e784984c19d486b91e8ef162dfb9a 100644 (file)
@@ -1822,8 +1822,8 @@ static int set_config_cgroup_relative(const char *key, const char *value,
                return clr_config_cgroup_relative(key, lxc_conf, NULL);
 
        ret = lxc_safe_uint(value, &converted);
-       if (ret < 0)
-               return -ret;
+       if (ret)
+               return ret;
 
        if (converted == 1) {
                lxc_conf->cgroup_meta.relative = true;
@@ -1835,7 +1835,7 @@ static int set_config_cgroup_relative(const char *key, const char *value,
                return 0;
        }
 
-       return -EINVAL;
+       return ret_errno(EINVAL);
 }
 
 static bool parse_limit_value(const char **value, rlim_t *res)