@@ -249,7 +249,7 @@ static void service_handle_watchdog(Service *s) {
249249 return ;
250250 }
251251
252- r = unit_watch_timer (UNIT (s ), s -> watchdog_usec - offset , & s -> watchdog_watch );
252+ r = unit_watch_timer (UNIT (s ), CLOCK_MONOTONIC , true, s -> watchdog_usec - offset , & s -> watchdog_watch );
253253 if (r < 0 )
254254 log_warning ("%s failed to install watchdog timer: %s" , UNIT (s )-> id , strerror (- r ));
255255}
@@ -1599,7 +1599,8 @@ static int service_coldplug(Unit *u) {
15991599
16001600 k = s -> deserialized_state == SERVICE_AUTO_RESTART ? s -> restart_usec : s -> timeout_start_usec ;
16011601
1602- if ((r = unit_watch_timer (UNIT (s ), k , & s -> timer_watch )) < 0 )
1602+ r = unit_watch_timer (UNIT (s ), CLOCK_MONOTONIC , true, k , & s -> timer_watch );
1603+ if (r < 0 )
16031604 return r ;
16041605 }
16051606 }
@@ -1744,7 +1745,7 @@ static int service_spawn(
17441745 }
17451746
17461747 if (timeout && s -> timeout_start_usec ) {
1747- r = unit_watch_timer (UNIT (s ), s -> timeout_start_usec , & s -> timer_watch );
1748+ r = unit_watch_timer (UNIT (s ), CLOCK_MONOTONIC , true, s -> timeout_start_usec , & s -> timer_watch );
17481749 if (r < 0 )
17491750 goto fail ;
17501751 } else
@@ -1899,7 +1900,7 @@ static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart)
18991900 !set_contains (s -> restart_ignore_status .signal , INT_TO_PTR (s -> main_exec_status .status )))
19001901 ) {
19011902
1902- r = unit_watch_timer (UNIT (s ), s -> restart_usec , & s -> timer_watch );
1903+ r = unit_watch_timer (UNIT (s ), CLOCK_MONOTONIC , true, s -> restart_usec , & s -> timer_watch );
19031904 if (r < 0 )
19041905 goto fail ;
19051906
@@ -2012,7 +2013,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
20122013
20132014 if (wait_for_exit ) {
20142015 if (s -> timeout_stop_usec > 0 ) {
2015- r = unit_watch_timer (UNIT (s ), s -> timeout_stop_usec , & s -> timer_watch );
2016+ r = unit_watch_timer (UNIT (s ), CLOCK_MONOTONIC , true, s -> timeout_stop_usec , & s -> timer_watch );
20162017 if (r < 0 )
20172018 goto fail ;
20182019 }
@@ -2262,7 +2263,7 @@ static void service_enter_restart(Service *s) {
22622263 /* Don't restart things if we are going down anyway */
22632264 log_info ("Stop job pending for unit, delaying automatic restart." );
22642265
2265- r = unit_watch_timer (UNIT (s ), s -> restart_usec , & s -> timer_watch );
2266+ r = unit_watch_timer (UNIT (s ), CLOCK_MONOTONIC , true, s -> restart_usec , & s -> timer_watch );
22662267 if (r < 0 )
22672268 goto fail ;
22682269
0 commit comments