From 0c48b874fda6f23bee0a438ca67b4dc0a1e98dcb Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Tue, 8 Dec 2020 14:52:42 +0100 Subject: [PATCH] confile: cleanup set_config_log_level() Signed-off-by: Christian Brauner --- src/lxc/confile.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 57ea4dc08..7f42b9b1f 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -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; } -- 2.47.2