diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c index 4c1a9687183..2d79f7147a8 100644 --- a/src/shared/watchdog.c +++ b/src/shared/watchdog.c @@ -261,12 +261,15 @@ static int update_pretimeout(void) { static int update_timeout(void) { int r; + usec_t previous_timeout; assert(watchdog_timeout > 0); if (watchdog_fd < 0) return 0; + previous_timeout = watchdog_timeout; + if (watchdog_timeout != USEC_INFINITY) { r = watchdog_set_timeout(); if (r < 0) { @@ -281,8 +284,12 @@ static int update_timeout(void) { if (watchdog_timeout == USEC_INFINITY) { r = watchdog_read_timeout(); - if (r < 0) - return log_error_errno(r, "Failed to query watchdog HW timeout: %m"); + if (r < 0) { + if (!ERRNO_IS_NOT_SUPPORTED(r)) + return log_error_errno(r, "Failed to query watchdog HW timeout: %m"); + log_info("Reading watchdog timeout is not supported, reusing the configured timeout."); + watchdog_timeout = previous_timeout; + } } /* If the watchdog timeout was changed, the pretimeout could have been