1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

networkd-address: Use DIV_ROUND_UP for consistency

Use DIV_ROUND_UP for consistency instead of the previous construct.
This commit is contained in:
Patrik Flykt 2017-06-16 09:09:35 +03:00
parent 945e32252e
commit 6abd0ef387

View File

@ -1169,10 +1169,10 @@ int config_parse_prefix_lifetime(const char *unit,
/* a value of 0xffffffff represents infinity */ /* a value of 0xffffffff represents infinity */
if (streq(lvalue, "PreferredLifetimeSec")) if (streq(lvalue, "PreferredLifetimeSec"))
r = sd_radv_prefix_set_preferred_lifetime(p->radv_prefix, r = sd_radv_prefix_set_preferred_lifetime(p->radv_prefix,
(usec + USEC_PER_SEC - 1) / USEC_PER_SEC); DIV_ROUND_UP(usec, USEC_PER_SEC));
else if (streq(lvalue, "ValidLifetimeSec")) else if (streq(lvalue, "ValidLifetimeSec"))
r = sd_radv_prefix_set_valid_lifetime(p->radv_prefix, r = sd_radv_prefix_set_valid_lifetime(p->radv_prefix,
(usec + USEC_PER_SEC - 1) / USEC_PER_SEC); DIV_ROUND_UP(usec, USEC_PER_SEC));
if (r < 0) if (r < 0)
return r; return r;