Skip to content

Commit 1266329

Browse files
committed
core: watchdog_runtimeout_wait() already returns USEC_INFINITY when the watchdog is disabled or closed
1 parent 3178d23 commit 1266329

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/core/manager.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ int manager_loop(Manager *m) {
29782978
return log_error_errno(r, "Failed to enable SIGCHLD event source: %m");
29792979

29802980
while (m->objective == MANAGER_OK) {
2981-
usec_t wait_usec, watchdog_usec;
2981+
usec_t watchdog_usec;
29822982

29832983
watchdog_usec = manager_get_watchdog(m, WATCHDOG_RUNTIME);
29842984
if (m->runtime_watchdog_running)
@@ -3020,12 +3020,7 @@ int manager_loop(Manager *m) {
30203020
continue;
30213021

30223022
/* Sleep for watchdog runtime wait time */
3023-
if (timestamp_is_set(watchdog_usec))
3024-
wait_usec = watchdog_runtime_wait();
3025-
else
3026-
wait_usec = USEC_INFINITY;
3027-
3028-
r = sd_event_run(m->event, wait_usec);
3023+
r = sd_event_run(m->event, watchdog_runtime_wait());
30293024
if (r < 0)
30303025
return log_error_errno(r, "Failed to run event loop: %m");
30313026
}

0 commit comments

Comments
 (0)