]> granicus.if.org Git - libevent/commitdiff
r15220@catbus: nickm | 2007-09-20 14:22:57 -0400
authorNick Mathewson <nickm@torproject.org>
Thu, 20 Sep 2007 18:27:01 +0000 (18:27 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 20 Sep 2007 18:27:01 +0000 (18:27 +0000)
 Another patch from Trond: Skip calling gettime() in timeout_process if we have no events in the timetree.

svn:r445

ChangeLog
event.c

index 2bcfa58a3c8fd46b35f93c3d553123298dcd2527..84879a33c036f7633aeb0e29f7a0de731a57f368 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,4 +20,5 @@ Changes in current version:
  o Add an evutil module (with header evutil.h) to implement our standard cross-platform hacks, on the theory that somebody else would like to use them too.
  o Fix signals implementation on windows.
  o Fix http module on windows to close sockets properly.
- o Make autogen.sh script run correctly on systems where /bin/sh isn't bash. (Patch from Trond Norbye, rewritten by Hagne Mahre and then Hannah Schroeter.)
\ No newline at end of file
+ o Make autogen.sh script run correctly on systems where /bin/sh isn't bash. (Patch from Trond Norbye, rewritten by Hagne Mahre and then Hannah Schroeter.)
+ o Skip calling gettime() in timeout_process if we are not in fact waiting for any events. (Patch from Trond Norbye)
diff --git a/event.c b/event.c
index 2af11a7db84072795e4c564ce66cb97bef9db297..4568ebb0714f1cce71c1eee9c8ee9e6dd6a150c3 100644 (file)
--- a/event.c
+++ b/event.c
@@ -807,6 +807,9 @@ timeout_process(struct event_base *base)
        struct timeval now;
        struct event *ev, *next;
 
+       if (RB_EMPTY(&base->timetree))
+               return;
+
        gettime(&now);
 
        for (ev = RB_MIN(event_tree, &base->timetree); ev; ev = next) {