From: Nick Mathewson Date: Wed, 20 Oct 2004 23:15:49 +0000 (+0000) Subject: Use bitwise masking to turn off bits, not compare-and-subtract X-Git-Tag: debian-version-0.0.8+0.0.9pre5-1~209 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88cffc3c5f35eb55c1834f494909fffd8b3f1f13;p=thirdparty%2Ftor.git Use bitwise masking to turn off bits, not compare-and-subtract svn:r2572 --- 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. */