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

[Libevent-users] A patch to test/bench.c



Hi there,

I found that test/bench not working in 2.0.6rc. here's a simple fix:

diff --git a/test/bench.c b/test/bench.c
index 76717d7..de4e814 100644
--- a/test/bench.c
+++ b/test/bench.c
@@ -85,7 +85,8 @@ run_once(void)
        static struct timeval ts, te;

        for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {
-               event_del(&events[i]);
+               if (events[i].ev_base)
+                       event_del(&events[i]);
                event_set(&events[i], cp[0], EV_READ | EV_PERSIST,
read_cb, (void *) i);
                event_add(&events[i], NULL);
        }


Regards,
Shuo
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.