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.40.2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=533aabc5def9f20633678a13aea66f2e749cb272;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 (cherry picked from commit 8bd4d796f4d6a0480c0744302ca40fa5ad5de070) --- 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;