From da6e7cd49588f6149166e05e7b7b725b360ab72c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 17 Aug 2010 13:26:03 -0400 Subject: [PATCH] Correctly detect failure to delete bufferevent read-timeout event Gilad Benjamini noted that we check the error code for deleting a write-timeout event twice, and the read timeout not at all. This shouldn't be a bit problem, since it's really hard for a delete to fail on a timeout-only event, but it's worth fixing. Fixes bug 3046787 --- bufferevent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bufferevent.c b/bufferevent.c index 9080c5e2..9923bbe0 100644 --- a/bufferevent.c +++ b/bufferevent.c @@ -788,7 +788,7 @@ _bufferevent_del_generic_timeout_cbs(struct bufferevent *bev) int r1,r2; r1 = event_del(&bev->ev_read); r2 = event_del(&bev->ev_write); - if (r2<0 || r2<0) + if (r1<0 || r2<0) return -1; return 0; } -- 2.40.0