]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wdctl: always query device node when sysfs is unavailable
authorThomas Weißschuh <thomas@t-8ch.de>
Tue, 4 Jun 2024 19:06:49 +0000 (21:06 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 4 Jun 2024 19:06:49 +0000 (21:06 +0200)
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 <thomas@t-8ch.de>
sys-utils/wdctl.c

index 86119248aa95f0cd2344508d9b7c9f697a477b50..e4ed3839995a547931cfe702ba5f6b50c3f9801c 100644 (file)
@@ -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;