mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
network-wait-online: use sd_event_add_time_relative()
This commit is contained in:
parent
4e5cbc4b17
commit
6d12f1b787
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user