summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/man/man9/timeout.910
-rw-r--r--sys/kern/subr_taskqueue.c2
-rw-r--r--sys/net/if_llatbl.c2
-rw-r--r--sys/netinet/in.c2
-rw-r--r--sys/netinet/tcp_timer.c4
-rw-r--r--sys/netinet6/in6.c2
-rw-r--r--sys/netinet6/nd6.c2
-rw-r--r--sys/netpfil/pf/if_pfsync.c4
8 files changed, 14 insertions, 14 deletions
diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9
index 3f3841ece53c..58905bcd1d55 100644
--- a/share/man/man9/timeout.9
+++ b/share/man/man9/timeout.9
@@ -302,7 +302,7 @@ If
.Fa c
already has a pending callout,
it is cancelled before the new invocation is scheduled.
-These functions return a non-zero value if a pending callout was cancelled
+These functions return a value of one if a pending callout was cancelled
and zero if there was no pending callout.
If the callout has an associated lock,
then that lock must be held when any of these functions are called.
@@ -804,16 +804,16 @@ The
.Fn callout_reset
and
.Fn callout_schedule
-function families return non-zero if the callout was pending before the new
+function families return a value of one if the callout was pending before the new
function invocation was scheduled.
.Pp
The
.Fn callout_stop
and
.Fn callout_drain
-functions return non-zero if the callout was still pending when it was
-called or zero otherwise.
-The
+functions return a value of one if the callout was still pending when it was
+called, a zero if the callout could not be stopped and a negative one is it
+was either not running or haas already completed. The
.Fn timeout
function returns a
.Ft struct callout_handle
diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c
index f0a5a1ba85e4..c90d0e261027 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;
diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c
index 1c16b2d629af..0a8922554604 100644
--- a/sys/net/if_llatbl.c
+++ b/sys/net/if_llatbl.c
@@ -394,7 +394,7 @@ lltable_free(struct lltable *llt)
IF_AFDATA_WUNLOCK(llt->llt_ifp);
LIST_FOREACH_SAFE(lle, &dchain, lle_chain, next) {
- if (callout_stop(&lle->lle_timer))
+ if (callout_stop(&lle->lle_timer) > 0)
LLE_REMREF(lle);
llentry_free(lle);
}
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index ce80d9555b67..dcf10f1ef32c 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1093,7 +1093,7 @@ in_lltable_free_entry(struct lltable *llt, struct llentry *lle)
}
/* cancel timer */
- if (callout_stop(&lle->lle_timer))
+ if (callout_stop(&lle->lle_timer) > 0)
LLE_REMREF(lle);
/* Drop hold queue */
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index d39339674970..d129586452a9 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -862,7 +862,7 @@ tcp_timer_activate(struct tcpcb *tp, uint32_t timer_type, u_int delta)
}
if (delta == 0) {
if ((tp->t_timers->tt_flags & timer_type) &&
- callout_stop(t_callout) &&
+ (callout_stop(t_callout) > 0) &&
(tp->t_timers->tt_flags & f_reset)) {
tp->t_timers->tt_flags &= ~(timer_type | f_reset);
}
@@ -949,7 +949,7 @@ tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type)
}
if (tp->t_timers->tt_flags & timer_type) {
- if (callout_stop(t_callout) &&
+ if ((callout_stop(t_callout) > 0) &&
(tp->t_timers->tt_flags & f_reset)) {
tp->t_timers->tt_flags &= ~(timer_type | f_reset);
} else {
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 65e7ab0d7b20..cae186d6db4c 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -2133,7 +2133,7 @@ in6_lltable_free_entry(struct lltable *llt, struct llentry *lle)
lltable_unlink_entry(llt, lle);
}
- if (callout_stop(&lle->lle_timer))
+ if (callout_stop(&lle->lle_timer) > 0)
LLE_REMREF(lle);
llentry_free(lle);
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 46f09239b032..b3fe0025e1f8 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -508,7 +508,7 @@ nd6_llinfo_settimer_locked(struct llentry *ln, long tick)
nd6_llinfo_timer, ln);
}
}
- if (canceled)
+ if (canceled > 0)
LLE_REMREF(ln);
}
diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index 516a92a01cc1..09d707c73dcf 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -352,7 +352,7 @@ pfsync_clone_destroy(struct ifnet *ifp)
TAILQ_REMOVE(&sc->sc_deferrals, pd, pd_entry);
sc->sc_deferred--;
- if (callout_stop(&pd->pd_tmo)) {
+ if (callout_stop(&pd->pd_tmo) > 0) {
pf_release_state(pd->pd_st);
m_freem(pd->pd_m);
free(pd, M_PFSYNC);
@@ -1775,7 +1775,7 @@ pfsync_undefer_state(struct pf_state *st, int drop)
TAILQ_FOREACH(pd, &sc->sc_deferrals, pd_entry) {
if (pd->pd_st == st) {
- if (callout_stop(&pd->pd_tmo))
+ if (callout_stop(&pd->pd_tmo) > 0)
pfsync_undefer(pd, drop);
return;
}