[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] A patch to test/bench.c
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users] A patch to test/bench.c
- From: Shuo Chen <giantchen@xxxxxxxxx>
- Date: Mon, 6 Sep 2010 20:09:13 +0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Mon, 06 Sep 2010 08:09:39 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=hYkl4/vA4egE80TrOv67/tvamcXhrhNdSwJ6/w6tB8Q=; b=Q75mz1u6RD95OxzEka7LLS7zsXIatMDRM6VCKyOf/ZUpXSsKfhg+ItgElkOPkRqF8y aov1lgOzM0XsaztmFfW7TIM/i0NWaiHMVRFJ2xs4BFsqNAZhWX1n13UKqF+KafZx6rfl OEnS8Obmx/EEr5sf0SFh2CbxEl4i2z5J4wBn4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=oCj/P0e1Tj6al7y6o2hYAasU/k4NzXGCB3DAyt9kSOvABdx2dUe0kjv4eC/Wlxh9y9 YLfiM7WcPUMnF9lLg6ormuTPAy71XBoGTfFXAXbxET9eOB3YEUGN/IBlJGak4YgrzSxa s6QNjmZph/PIOPuSWGGE32h0WBbXZbbs2Y6hQ=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
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.