svn commit: r290805 - in head: share/man/man9 sys/kern sys/net sys/netinet sys/netinet6 sys/netpfil/pf

Gleb Smirnoff glebius at FreeBSD.org
Fri Nov 13 23:11:06 UTC 2015


  Randall,

On Fri, Nov 13, 2015 at 10:51:36PM +0000, Randall Stewart wrote:
R> Author: rrs
R> Date: Fri Nov 13 22:51:35 2015
R> New Revision: 290805
R> URL: https://svnweb.freebsd.org/changeset/base/290805
R> 
R> Log:
R>   This fixes several places where callout_stops return is examined. The
R>   new return codes of -1 were mistakenly being considered "true". Callout_stop
R>   now returns -1 to indicate the callout had either already completed or
R>   was not running and 0 to indicate it could not be stopped.  Also update
R>   the manual page to make it more consistent no non-zero in the callout_stop
R>   or callout_reset descriptions.

What about making callout_stop() return value a enum?

enum {
	NOTRUN = 1,
	COMPLETED,
	RUNNING,
	PENDING,
};

Will make code more comprehendable, than now:

	pending = !!(callout_stop(&timeout_task->c) > 0);

will be

	pending = callout_stop(&timeout_task->c) >= RUNNING;

-- 
Totus tuus, Glebius.


More information about the svn-src-head mailing list