confile: cleanup set_config_time_offset_monotonic()

parent b9965fd7
......@@ -2754,18 +2754,18 @@ static int set_config_time_offset_monotonic(const char *key, const char *value,
unit = lxc_trim_whitespace_in_place(buf);
if (strcmp(unit, "h") == 0) {
if (!multiply_overflow(offset, 3600, &lxc_conf->timens.s_monotonic))
return -EOVERFLOW;
return ret_errno(EOVERFLOW);
} else if (strcmp(unit, "m") == 0) {
if (!multiply_overflow(offset, 60, &lxc_conf->timens.s_monotonic))
return -EOVERFLOW;
return ret_errno(EOVERFLOW);
} else if (strcmp(unit, "s") == 0) {
lxc_conf->timens.s_monotonic = offset;
} else if (strcmp(unit, "ms") == 0) {
if (!multiply_overflow(offset, 1000000, &lxc_conf->timens.ns_monotonic))
return -EOVERFLOW;
return ret_errno(EOVERFLOW);
} else if (strcmp(unit, "us") == 0) {
if (!multiply_overflow(offset, 1000, &lxc_conf->timens.ns_monotonic))
return -EOVERFLOW;
return ret_errno(EOVERFLOW);
} else if (strcmp(unit, "ns") == 0) {
lxc_conf->timens.ns_monotonic = offset;
} else {
......
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