summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2015-11-13 22:51:35 +0000
committerrrs <rrs@FreeBSD.org>2015-11-13 22:51:35 +0000
commitdc494194a2039a69fc3073f4ef4d628b955a0b25 (patch)
tree8d27e0d0e4a2ccb1fcf414f3765ec6a6e6de9611 /sys/kern
parente3347af437af55376a333371d3c62fb46c99b67d (diff)
downloadFreeBSD-src-dc494194a2039a69fc3073f4ef4d628b955a0b25.zip
FreeBSD-src-dc494194a2039a69fc3073f4ef4d628b955a0b25.tar.gz
This fixes several places where callout_stops return is examined. The
new return codes of -1 were mistakenly being considered "true". Callout_stop now returns -1 to indicate the callout had either already completed or was not running and 0 to indicate it could not be stopped. Also update the manual page to make it more consistent no non-zero in the callout_stop or callout_reset descriptions. MFC after: 1 Month with associated callout change.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_taskqueue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c
index f0a5a1b..c90d0e2 100644
--- a/sys/kern/subr_taskqueue.c
+++ b/sys/kern/subr_taskqueue.c
@@ -496,7 +496,7 @@ taskqueue_cancel_timeout(struct taskqueue *queue,
int error;
TQ_LOCK(queue);
- pending = !!callout_stop(&timeout_task->c);
+ pending = !!(callout_stop(&timeout_task->c) > 0);
error = taskqueue_cancel_locked(queue, &timeout_task->t, &pending1);
if ((timeout_task->f & DT_CALLOUT_ARMED) != 0) {
timeout_task->f &= ~DT_CALLOUT_ARMED;
OpenPOWER on IntegriCloud