From 88cffc3c5f35eb55c1834f494909fffd8b3f1f13 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 20 Oct 2004 23:15:49 +0000 Subject: [PATCH] Use bitwise masking to turn off bits, not compare-and-subtract svn:r2572 --- src/or/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/or/main.c b/src/or/main.c index b0bb65a343..165f9c8b52 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -191,8 +191,7 @@ void connection_stop_reading(connection_t *conn) { tor_assert(conn->poll_index < nfds); log(LOG_DEBUG,"connection_stop_reading() called."); - if(poll_array[conn->poll_index].events & POLLIN) - poll_array[conn->poll_index].events -= POLLIN; + poll_array[conn->poll_index].events &= ~POLLIN; } /** Tell the main loop to start notifying conn of any read events. */ @@ -213,8 +212,7 @@ void connection_stop_writing(connection_t *conn) { tor_assert(conn); tor_assert(conn->poll_index >= 0); tor_assert(conn->poll_index < nfds); - if(poll_array[conn->poll_index].events & POLLOUT) - poll_array[conn->poll_index].events -= POLLOUT; + poll_array[conn->poll_index].events &= ~POLLOUT; } /** Tell the main loop to start notifying conn of any write events. */