From: Thomas Weißschuh Date: Tue, 4 Jun 2024 19:06:49 +0000 (+0200) Subject: wdctl: always query device node when sysfs is unavailable X-Git-Tag: v2.42-start~305^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8bd4d796f4d6a0480c0744302ca40fa5ad5de070;p=thirdparty%2Futil-linux.git wdctl: always query device node when sysfs is unavailable 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 --- 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;