mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
watchdog: fix fd validity check
This commit is contained in:
parent
ef52fa5bd1
commit
d9752ca196
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user