From 2e4f7510d94a26f1cd9ae67ea9c88535cea9c193 Mon Sep 17 00:00:00 2001 From: n_hibma Date: Tue, 27 Mar 2007 21:03:37 +0000 Subject: Revisit the watchdogs: Resetting the error to EINVAL after failing to set the watchdog might hide the succesful arming of an earlier one. Accept that on failing to arm any watchdog (because of non-supported timeouts) EOPNOTSUPP is returned instead of the more appropriate EINVAL. MFC after: 3 days --- sys/dev/watchdog/watchdog.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/dev/watchdog') diff --git a/sys/dev/watchdog/watchdog.c b/sys/dev/watchdog/watchdog.c index a1d8d88..06498c9 100644 --- a/sys/dev/watchdog/watchdog.c +++ b/sys/dev/watchdog/watchdog.c @@ -55,6 +55,8 @@ 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_ACTIVE | WD_PASSIVE)) == 0 && (u & WD_INTERVAL) > 0) + return (EINVAL); if (u & WD_PASSIVE) return (ENOSYS); /* XXX Not implemented yet */ if ((u & WD_INTERVAL) == WD_TO_NEVER) { -- cgit v1.1