From 8bd4d796f4d6a0480c0744302ca40fa5ad5de070 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Tue, 4 Jun 2024 21:06:49 +0200 Subject: [PATCH] wdctl: always query device node when sysfs is unavailable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When there is no sysfs at all for the watchdog, fall back to reading from the device node. This is also useful if the legacy compat /dev/watchdog device which never has a sysfs interface. Closes: #3073 Signed-off-by: Thomas Weißschuh --- sys-utils/wdctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c index 86119248a..e4ed38399 100644 --- a/sys-utils/wdctl.c +++ b/sys-utils/wdctl.c @@ -608,6 +608,9 @@ static int read_governors(struct wd_device *wd) static bool should_read_from_device(struct wd_device *wd) { + if (wd->no_sysfs) + return true; + if (!wd->has_nowayout) return false; -- 2.47.2