diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-01-22 16:14:49 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-01-22 16:14:49 -0500 |
commit | ff3f6cd42b8d58d6db9c2ceb2cf9868d1a8f7ec0 (patch) | |
tree | 4fb607e14f39043f1f8a0d05c99a3d4e37bae1a3 /bufferevent_async.c | |
parent | 7296971b105ffc2bc9d20b0a24a3055c2ecf5e69 (diff) | |
download | libevent-ff3f6cd42b8d58d6db9c2ceb2cf9868d1a8f7ec0.tar.gz |
Check more internal event_add() calls for failure
Most of these should be unable to fail, since adding a timeout
generally always works. Still, it's better not to try to be "too
smart for our own good here."
There are some remaining event_add() calls that I didn't add checks
for; I've marked those with "XXXX" comments.
Diffstat (limited to 'bufferevent_async.c')
-rw-r--r-- | bufferevent_async.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bufferevent_async.c b/bufferevent_async.c index 3d21d4c1..085a2db8 100644 --- a/bufferevent_async.c +++ b/bufferevent_async.c @@ -242,7 +242,8 @@ be_async_enable(struct bufferevent *buf, short what) return -1; /* NOTE: This interferes with non-blocking connect */ - _bufferevent_generic_adj_timeouts(buf); + if (_bufferevent_generic_adj_timeouts(buf) < 0) + return -1; /* If we newly enable reading or writing, and we aren't reading or writing already, consider launching a new read or write. */ |