summaryrefslogtreecommitdiffstats
path: root/src/network/wait-online
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-05 17:53:34 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-05 19:27:23 +0100
commit6d12f1b7876db48c591383d042e564cf0731095e (patch)
tree21743c747237f18196837a74d556217ca34d3148 /src/network/wait-online
parentefi: introduce UINT32_MAX and UINT64_MAX (diff)
downloadsystemd-6d12f1b7876db48c591383d042e564cf0731095e.tar.xz
systemd-6d12f1b7876db48c591383d042e564cf0731095e.zip
network-wait-online: use sd_event_add_time_relative()
Diffstat (limited to 'src/network/wait-online')
-rw-r--r--src/network/wait-online/manager.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/network/wait-online/manager.c b/src/network/wait-online/manager.c
index 9710742123..1438b27445 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;
}