From: Yu Watanabe Date: Wed, 22 Jun 2022 07:22:39 +0000 (+0900) Subject: core: close watchdog device if watchdog device is unspecified now X-Git-Tag: v252-rc1~779^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82d7a151db3f504fee705bcd0ded2fa0d64eafb2;p=thirdparty%2Fsystemd.git core: close watchdog device if watchdog device is unspecified now If a watchdog device was specified previously, and unspecified later and PID1 is reloaded, then we need to close the device. --- diff --git a/src/core/main.c b/src/core/main.c index b796dc8c2a0..7cd13b9e13e 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2118,11 +2118,9 @@ static int initialize_runtime( write_container_id(); } - if (arg_watchdog_device) { - r = watchdog_set_device(arg_watchdog_device); - if (r < 0) - log_warning_errno(r, "Failed to set watchdog device to %s, ignoring: %m", arg_watchdog_device); - } + r = watchdog_set_device(arg_watchdog_device); + if (r < 0) + log_warning_errno(r, "Failed to set watchdog device to %s, ignoring: %m", arg_watchdog_device); } else { _cleanup_free_ char *p = NULL;