From ef52fa5bd1bef763e8bac82abf040cb695827dac Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 18 Oct 2021 11:26:49 +0200 Subject: [PATCH] watchdog: drop unnecessary variable --- src/shared/watchdog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c index c23a4cbac4..4317d90b24 100644 --- a/src/shared/watchdog.c +++ b/src/shared/watchdog.c @@ -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");