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

arma at seul.org arma at seul.org
Sat Nov 26 09:37:03 UTC 2005


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.
(nick, do i have my libevent strerror dance moves correct?)


Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.594
retrieving revision 1.595
diff -u -d -r1.594 -r1.595
--- main.c	26 Nov 2005 01:43:57 -0000	1.594
+++ main.c	26 Nov 2005 09:37:00 -0000	1.595
@@ -261,8 +261,9 @@
 
   if (r<0)
     warn(LD_NET,
-         "Error from libevent setting read event state for %d to %swatched.",
-         conn->s, (events & EV_READ)?"":"un");
+         "Error from libevent setting read event state for %d to %swatched: %s",
+         conn->s, (events & EV_READ)?"":"un",
+         tor_socket_strerror(tor_socket_errno(conn->s)));
 
   if (events & EV_WRITE) {
     r = event_add(conn->write_event, NULL);
@@ -272,8 +273,9 @@
 
   if (r<0)
     warn(LD_NET,
-         "Error from libevent setting read event state for %d to %swatched.",
-         conn->s, (events & EV_WRITE)?"":"un");
+         "Error from libevent setting read event state for %d to %swatched: %s",
+         conn->s, (events & EV_WRITE)?"":"un",
+         tor_socket_strerror(tor_socket_errno(conn->s)));
 }
 
 /** Return true iff <b>conn</b> is listening for read events. */



More information about the tor-commits mailing list