From bdd466ffca17a71a175124c09757c8ca6f54d280 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sat, 19 Mar 2005 01:46:37 +0000 Subject: [PATCH] When disarming a watchdog by using an interval of WD_TO_NEVER a non-zero return value of the ioctl doesn't indicate that the command has failed so don't let watchdog(8) return an error in this case. MFC after: 3 days --- usr.sbin/watchdogd/watchdogd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/watchdogd/watchdogd.c b/usr.sbin/watchdogd/watchdogd.c index 0c1b6258bed..321fc5db79a 100644 --- a/usr.sbin/watchdogd/watchdogd.c +++ b/usr.sbin/watchdogd/watchdogd.c @@ -120,7 +120,8 @@ main(int argc, char *argv[]) timeout |= WD_PASSIVE; else timeout |= WD_ACTIVE; - if (watchdog_patpat() < 0) + if (watchdog_patpat() < 0 && + (timeout & WD_INTERVAL) != WD_TO_NEVER) err(EX_OSERR, "patting the dog"); return (EX_OK); }