From: Zbigniew Jędrzejewski-Szmek Date: Fri, 5 Mar 2021 16:53:34 +0000 (+0100) Subject: network-wait-online: use sd_event_add_time_relative() X-Git-Tag: v248-rc3~41^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d12f1b7876db48c591383d042e564cf0731095e;p=thirdparty%2Fsystemd.git network-wait-online: use sd_event_add_time_relative() --- diff --git a/src/network/wait-online/manager.c b/src/network/wait-online/manager.c index 97107421239..1438b27445c 100644 --- a/src/network/wait-online/manager.c +++ b/src/network/wait-online/manager.c @@ -323,12 +323,8 @@ int manager_new(Manager **ret, Hashmap *interfaces, char **ignore, (void) sd_event_add_signal(m->event, NULL, SIGINT, NULL, NULL); if (timeout > 0) { - usec_t usec; - - usec = usec_add(now(clock_boottime_or_monotonic()), timeout); - - r = sd_event_add_time(m->event, NULL, clock_boottime_or_monotonic(), usec, 0, NULL, INT_TO_PTR(-ETIMEDOUT)); - if (r < 0) + r = sd_event_add_time_relative(m->event, NULL, clock_boottime_or_monotonic(), timeout, 0, NULL, INT_TO_PTR(-ETIMEDOUT)); + if (r < 0 && r != -EOVERFLOW) return r; }