diff --git a/sys/dev/watchdog/watchdog.c b/sys/dev/watchdog/watchdog.c index 782388588089..907324a036c2 100644 --- a/sys/dev/watchdog/watchdog.c +++ b/sys/dev/watchdog/watchdog.c @@ -55,9 +55,13 @@ wd_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, return (EINVAL); if ((u & (WD_ACTIVE | WD_PASSIVE)) == (WD_ACTIVE | WD_PASSIVE)) return (EINVAL); - if ((u & WD_INTERVAL) == WD_TO_NEVER) + + if ((u & WD_INTERVAL) == WD_TO_NEVER) { u = 0; - error = EOPNOTSUPP; + error = 0; + } else { + error = EOPNOTSUPP; + } EVENTHANDLER_INVOKE(watchdog_list, u, &error); return (error); }