Skip to content

Commit

Permalink
confile: cleanup set_config_log_level()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 8, 2020
1 parent 34f3b30 commit 806244c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/lxc/confile.c
Expand Up @@ -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;
Expand Down

0 comments on commit 806244c

Please sign in to comment.