]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: drop duplicated check in manager_{set,override}_watchdog
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 20 Dec 2024 13:31:49 +0000 (14:31 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 21 Mar 2025 10:30:26 +0000 (11:30 +0100)
Those functions call watchdog_setup() and watchdog_setup_pretimeout(), which
internally do a similar check against the static variables watchdog_timeout and
watchdog_pretimeout. The second check is not useful.

src/core/manager.c

index c6c9779976375af7918cf400d9f1d0e139b504d9..12c4e65e520cd739b88644186f6e9d455431ff76 100644 (file)
@@ -3582,9 +3582,6 @@ void manager_set_watchdog(Manager *m, WatchdogType t, usec_t timeout) {
         if (MANAGER_IS_USER(m))
                 return;
 
-        if (m->watchdog[t] == timeout)
-                return;
-
         if (m->watchdog_overridden[t] == USEC_INFINITY) {
                 if (t == WATCHDOG_RUNTIME)
                         (void) watchdog_setup(timeout);
@@ -3603,9 +3600,6 @@ void manager_override_watchdog(Manager *m, WatchdogType t, usec_t timeout) {
         if (MANAGER_IS_USER(m))
                 return;
 
-        if (m->watchdog_overridden[t] == timeout)
-                return;
-
         usec = timeout == USEC_INFINITY ? m->watchdog[t] : timeout;
         if (t == WATCHDOG_RUNTIME)
                 (void) watchdog_setup(usec);