1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

core: watchdog_runtimeout_wait() already returns USEC_INFINITY when the watchdog is disabled or closed

This commit is contained in:
Franck Bui 2021-09-06 11:06:35 +02:00
parent 3178d23ddd
commit 12663295ca

View File

@ -2978,7 +2978,7 @@ int manager_loop(Manager *m) {
return log_error_errno(r, "Failed to enable SIGCHLD event source: %m"); return log_error_errno(r, "Failed to enable SIGCHLD event source: %m");
while (m->objective == MANAGER_OK) { while (m->objective == MANAGER_OK) {
usec_t wait_usec, watchdog_usec; usec_t watchdog_usec;
watchdog_usec = manager_get_watchdog(m, WATCHDOG_RUNTIME); watchdog_usec = manager_get_watchdog(m, WATCHDOG_RUNTIME);
if (m->runtime_watchdog_running) if (m->runtime_watchdog_running)
@ -3020,12 +3020,7 @@ int manager_loop(Manager *m) {
continue; continue;
/* Sleep for watchdog runtime wait time */ /* Sleep for watchdog runtime wait time */
if (timestamp_is_set(watchdog_usec)) r = sd_event_run(m->event, watchdog_runtime_wait());
wait_usec = watchdog_runtime_wait();
else
wait_usec = USEC_INFINITY;
r = sd_event_run(m->event, wait_usec);
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to run event loop: %m"); return log_error_errno(r, "Failed to run event loop: %m");
} }