[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] event_base_dispatch returning -1 - help debugging




On Jun 12, 2012, at 11:21 PM, Nick Mathewson wrote:

Actually I think it's a C error.  Check out the documentation for
event_pending():
/*
 @return true if the event is pending on any of the events in 'what', (that
 is to say, it has been added), or 0 if the event is not added.
*/

Note that it says "@return true"; it doesn't say "@return 1".  In C,
any nonzero integer is true.

The documentation should probably be more clear that what it actually
returns its a bitfield of which flags are set, anded with its "events"
argument.

I don't think it will be a good idea to document what is returned for "true", because it will prevent changes in the implementation later.

How about "non-zero" instead of "true"?