Skip to content

Commit

Permalink
confile: cleanup set_config_time_offset_boot()
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 6c90df0 commit b9965fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lxc/confile.c
Expand Up @@ -2715,18 +2715,18 @@ static int set_config_time_offset_boot(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_boot))
return -EOVERFLOW;
return ret_errno(EOVERFLOW);
} else if (strcmp(unit, "m") == 0) {
if (!multiply_overflow(offset, 60, &lxc_conf->timens.s_boot))
return -EOVERFLOW;
return ret_errno(EOVERFLOW);
} else if (strcmp(unit, "s") == 0) {
lxc_conf->timens.s_boot = offset;
} else if (strcmp(unit, "ms") == 0) {
if (!multiply_overflow(offset, 1000000, &lxc_conf->timens.ns_boot))
return -EOVERFLOW;
return ret_errno(EOVERFLOW);
} else if (strcmp(unit, "us") == 0) {
if (!multiply_overflow(offset, 1000, &lxc_conf->timens.ns_boot))
return -EOVERFLOW;
return ret_errno(EOVERFLOW);
} else if (strcmp(unit, "ns") == 0) {
lxc_conf->timens.ns_boot = offset;
} else {
Expand Down

0 comments on commit b9965fd

Please sign in to comment.