]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
watchdog: drop unnecessary variable
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Oct 2021 09:26:49 +0000 (11:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 Oct 2021 09:27:39 +0000 (11:27 +0200)
src/shared/watchdog.c

index c23a4cbac4c07ed4f1c365871846f937d9a6a8f5..4317d90b24d629a7b2616597eccfeca49940827c 100644 (file)
@@ -22,12 +22,10 @@ static usec_t watchdog_last_ping = USEC_INFINITY;
 
 static int watchdog_set_enable(bool enable) {
         int flags = enable ? WDIOS_ENABLECARD : WDIOS_DISABLECARD;
-        int r;
 
         assert(watchdog_fd >= 0);
 
-        r = ioctl(watchdog_fd, WDIOC_SETOPTIONS, &flags);
-        if (r < 0) {
+        if (ioctl(watchdog_fd, WDIOC_SETOPTIONS, &flags) < 0) {
                 if (!enable)
                         return log_warning_errno(errno, "Failed to disable hardware watchdog, ignoring: %m");