From: Lennart Poettering Date: Mon, 18 Oct 2021 09:26:58 +0000 (+0200) Subject: watchdog: fix fd validity check X-Git-Tag: v250-rc1~483^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9752ca196853fa17d9b58e496f8c3668a9bc099;p=thirdparty%2Fsystemd.git watchdog: fix fd validity check --- diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c index 4317d90b24d..3f4c72826db 100644 --- a/src/shared/watchdog.c +++ b/src/shared/watchdog.c @@ -42,7 +42,7 @@ static int watchdog_set_enable(bool enable) { static int watchdog_get_timeout(void) { int sec = 0; - assert(watchdog_fd > 0); + assert(watchdog_fd >= 0); if (ioctl(watchdog_fd, WDIOC_GETTIMEOUT, &sec) < 0) return -errno;