]> 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:05 +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 4854acee415aa40a6cd8d0256db853e1e6f03c29..57ea4dc0843db38c7682087a57344e5ec6a51047 100644 (file)
@@ -1574,13 +1574,17 @@ static int set_config_log_level(const char *key, const char *value,
        }
 
        if (value[0] >= '0' && value[0] <= '9') {
-               if (lxc_safe_int(value, &newlevel) < 0)
-                       return -1;
+               int ret;
+
+               ret = lxc_safe_int(value, &newlevel);
+               if (ret)
+                       return ret_errno(EINVAL);
        } else {
                newlevel = lxc_log_priority_to_int(value);
        }
 
-       /* Store these values in the lxc_conf, and then try to set for actual
+       /*
+        * Store these values in the lxc_conf, and then try to set for actual
         * current logging.
         */
        lxc_conf->loglevel = newlevel;