[or-cvs] when event_add or event_del fail, tell us why.

Nick Mathewson nickm at freehaven.net
Mon Mar 13 23:48:42 UTC 2006


On Mon, Mar 13, 2006 at 02:33:49PM -0500, arma at seul.org wrote:
> Update of /home2/or/cvsroot/tor/src/or
> In directory moria:/home/arma/work/onion/cvs/tor/src/or
> 
> Modified Files:
> 	main.c 
> Log Message:
> when event_add or event_del fail, tell us why.
> 
> 
> Index: main.c
> ===================================================================
> RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
> retrieving revision 1.632
> retrieving revision 1.633
> diff -u -p -d -r1.632 -r1.633
> --- main.c	12 Mar 2006 23:31:16 -0000	1.632
> +++ main.c	13 Mar 2006 19:33:46 -0000	1.633
> @@ -319,8 +319,9 @@ connection_stop_reading(connection_t *co
>    log_debug(LD_NET,"connection_stop_reading() called.");
>    if (event_del(conn->read_event))
>      log_warn(LD_NET, "Error from libevent setting read event state for %d "
> -             "to unwatched.",
> -             conn->s);
> +             "to unwatched: %s",
> +             conn->s,
> +             tor_socket_strerror(tor_socket_errno(conn->s)));

Sadly, this approach isn't 100% reliable.  event_add and event_del can
fail for reasons that don't set errno.  I don't think this is a thing
we need to fix, but it's a thing we should keep in mind.

yrs,
-- 
Nick Mathewson



More information about the tor-commits mailing list