confile: cleanup set_config_ephemeral()

parent 29e78cb9
...@@ -3440,16 +3440,19 @@ bool network_new_hwaddrs(struct lxc_conf *conf) ...@@ -3440,16 +3440,19 @@ bool network_new_hwaddrs(struct lxc_conf *conf)
static int set_config_ephemeral(const char *key, const char *value, static int set_config_ephemeral(const char *key, const char *value,
struct lxc_conf *lxc_conf, void *data) struct lxc_conf *lxc_conf, void *data)
{ {
int ret;
if (lxc_config_value_empty(value)) { if (lxc_config_value_empty(value)) {
lxc_conf->ephemeral = 0; lxc_conf->ephemeral = 0;
return 0; return 0;
} }
if (lxc_safe_uint(value, &lxc_conf->ephemeral) < 0) ret = lxc_safe_uint(value, &lxc_conf->ephemeral);
return -1; if (ret < 0)
return ret;
if (lxc_conf->ephemeral > 1) if (lxc_conf->ephemeral > 1)
return -1; return ret_errno(EINVAL);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment