[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] A patch to test/bench.c
On Mon, Sep 6, 2010 at 8:09 AM, Shuo Chen <giantchen@xxxxxxxxx> wrote:
> 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);
> }
>
Good catch; I'm going to check it in, but using "event_initialized" in
place of looking at the event internals.
--
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.