mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
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.
This commit is contained in:
parent
e7f0053787
commit
bbd3832e6b
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue