From: Lennart Poettering Date: Mon, 18 Oct 2021 09:26:49 +0000 (+0200) Subject: watchdog: drop unnecessary variable X-Git-Tag: v250-rc1~483^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef52fa5bd1bef763e8bac82abf040cb695827dac;p=thirdparty%2Fsystemd.git watchdog: drop unnecessary variable --- diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c index c23a4cbac4c..4317d90b24d 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");