]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: watchdog_runtimeout_wait() already returns USEC_INFINITY when the watchdog...
authorFranck Bui <fbui@suse.com>
Mon, 6 Sep 2021 09:06:35 +0000 (11:06 +0200)
committerFranck Bui <fbui@suse.com>
Tue, 14 Sep 2021 19:39:21 +0000 (21:39 +0200)
src/core/manager.c

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