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

index 57ea4dc0843db38c7682087a57344e5ec6a51047..7f42b9b1f55d7122ed6637f1341e4a622d548461 100644 (file)
@@ -1595,16 +1595,19 @@ static int set_config_log_level(const char *key, const char *value,
 static int set_config_autodev(const char *key, const char *value,
                              struct lxc_conf *lxc_conf, void *data)
 {
+       int ret;
+
        if (lxc_config_value_empty(value)) {
                lxc_conf->autodev = 0;
                return 0;
        }
 
-       if (lxc_safe_uint(value, &lxc_conf->autodev) < 0)
-               return -1;
+       ret = lxc_safe_uint(value, &lxc_conf->autodev);
+       if (ret)
+               return ret_errno(EINVAL);
 
        if (lxc_conf->autodev > 1)
-               return -1;
+               return ret_errno(EINVAL);
 
        return 0;
 }