From dc494194a2039a69fc3073f4ef4d628b955a0b25 Mon Sep 17 00:00:00 2001 From: rrs Date: Fri, 13 Nov 2015 22:51:35 +0000 Subject: 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. --- sys/kern/subr_taskqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/kern') 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; -- cgit v1.1