summaryrefslogtreecommitdiffstats
path: root/src/shared/watchdog.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-05-29 17:38:36 +0200
committerLennart Poettering <lennart@poettering.net>2024-05-29 17:42:02 +0200
commitbbd3832e6bac0c945cfb2632b872e4bccb111f2b (patch)
tree4ecdb13970ba7b1646d89c4e0d24cb5e830b0e3d /src/shared/watchdog.c
parentwatchdog: normalize how we name watchdog related calls (diff)
downloadsystemd-bbd3832e6bac0c945cfb2632b872e4bccb111f2b.tar.xz
systemd-bbd3832e6bac0c945cfb2632b872e4bccb111f2b.zip
watchdog: reset last ping timestamp when opening watchdog
When we open a watchdog fresh we have never pinged it, hence reset the ping timestamp explicitly, so that it is not only reset the first time we open the device, but all times.
Diffstat (limited to '')
-rw-r--r--src/shared/watchdog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c
index 720f0343e9..810c5b5206 100644
--- a/src/shared/watchdog.c
+++ b/src/shared/watchdog.c
@@ -340,6 +340,8 @@ static int watchdog_open(void) {
if (watchdog_fd < 0)
return log_debug_errno(SYNTHETIC_ERRNO(ENOENT), "Failed to open watchdog device %s.", watchdog_device ?: "auto");
+ watchdog_last_ping = USEC_INFINITY;
+
if (ioctl(watchdog_fd, WDIOC_GETSUPPORT, &ident) < 0)
log_debug_errno(errno, "Hardware watchdog %s does not support WDIOC_GETSUPPORT ioctl, ignoring: %m", watchdog_device);
else