event->udev = udev;
udev_list_init(udev, &event->run_list, false);
udev_list_init(udev, &event->seclabel_list, false);
- event->birth_usec = clock_boottime_or_monotonic();
+ event->birth_usec = now(CLOCK_MONOTONIC);
return event;
}
if (timeout_usec > 0) {
usec_t age_usec;
- age_usec = clock_boottime_or_monotonic() - event->birth_usec;
+ age_usec = now(CLOCK_MONOTONIC) - event->birth_usec;
if (age_usec >= timeout_usec) {
log_error("timeout '%s'", cmd);
return;
if (timeout_usec > 0) {
usec_t usec, age_usec;
- usec = now(clock_boottime_or_monotonic());
+ usec = now(CLOCK_MONOTONIC);
age_usec = usec - event->birth_usec;
if (age_usec < timeout_usec) {
if (timeout_warn_usec > 0 && timeout_warn_usec < timeout_usec && age_usec < timeout_warn_usec) {
spawn.timeout_warn = timeout_warn_usec - age_usec;
- r = sd_event_add_time(e, NULL, clock_boottime_or_monotonic(),
+ r = sd_event_add_time(e, NULL, CLOCK_MONOTONIC,
usec + spawn.timeout_warn, USEC_PER_SEC,
on_spawn_timeout_warning, &spawn);
if (r < 0)
spawn.timeout = timeout_usec - age_usec;
- r = sd_event_add_time(e, NULL, clock_boottime_or_monotonic(),
+ r = sd_event_add_time(e, NULL, CLOCK_MONOTONIC,
usec + spawn.timeout, USEC_PER_SEC, on_spawn_timeout, &spawn);
if (r < 0)
return r;
e = worker->manager->event;
- assert_se(sd_event_now(e, clock_boottime_or_monotonic(), &usec) >= 0);
+ assert_se(sd_event_now(e, CLOCK_MONOTONIC, &usec) >= 0);
- (void) sd_event_add_time(e, &event->timeout_warning, clock_boottime_or_monotonic(),
+ (void) sd_event_add_time(e, &event->timeout_warning, CLOCK_MONOTONIC,
usec + arg_event_timeout_warn_usec, USEC_PER_SEC, on_event_timeout_warning, event);
- (void) sd_event_add_time(e, &event->timeout, clock_boottime_or_monotonic(),
+ (void) sd_event_add_time(e, &event->timeout, CLOCK_MONOTONIC,
usec + arg_event_timeout_usec, USEC_PER_SEC, on_event_timeout, event);
}
event_queue_cleanup(manager, EVENT_QUEUED);
manager_kill_workers(manager);
- assert_se(sd_event_now(manager->event, clock_boottime_or_monotonic(), &usec) >= 0);
+ assert_se(sd_event_now(manager->event, CLOCK_MONOTONIC, &usec) >= 0);
- r = sd_event_add_time(manager->event, NULL, clock_boottime_or_monotonic(),
+ r = sd_event_add_time(manager->event, NULL, CLOCK_MONOTONIC,
usec + 30 * USEC_PER_SEC, USEC_PER_SEC, on_exit_timeout, manager);
if (r < 0)
return;
manager->exit || manager->stop_exec_queue)
return;
- assert_se(sd_event_now(manager->event, clock_boottime_or_monotonic(), &usec) >= 0);
+ assert_se(sd_event_now(manager->event, CLOCK_MONOTONIC, &usec) >= 0);
/* check for changed config, every 3 seconds at most */
if (manager->last_usec == 0 ||
(usec - manager->last_usec) > 3 * USEC_PER_SEC) {