diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2007-03-27 21:03:37 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2007-03-27 21:03:37 +0000 |
commit | 2e4f7510d94a26f1cd9ae67ea9c88535cea9c193 (patch) | |
tree | c7550e0408ca0d79f56a9e6d3c0a0ca79a6f86e2 /sys/dev/watchdog | |
parent | 2f20235351089bb6e52be91ffa6c7bf6ded46a69 (diff) | |
download | FreeBSD-src-2e4f7510d94a26f1cd9ae67ea9c88535cea9c193.zip FreeBSD-src-2e4f7510d94a26f1cd9ae67ea9c88535cea9c193.tar.gz |
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
Diffstat (limited to 'sys/dev/watchdog')
-rw-r--r-- | sys/dev/watchdog/watchdog.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) { |