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 806244c commit 0c48b87
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lxc/confile.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0c48b87

Please sign in to comment.