diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-10-20 23:15:49 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-10-20 23:15:49 +0000 |
commit | 88cffc3c5f35eb55c1834f494909fffd8b3f1f13 (patch) | |
tree | 91e02eb6672b00dbf59173e201b1c9e7a3f4b6bb /src | |
parent | c3a15d1c745e3021abbe767689f113569adc7292 (diff) | |
download | tor-88cffc3c5f35eb55c1834f494909fffd8b3f1f13.tar.gz tor-88cffc3c5f35eb55c1834f494909fffd8b3f1f13.zip |
Use bitwise masking to turn off bits, not compare-and-subtract
svn:r2572
Diffstat (limited to 'src')
-rw-r--r-- | src/or/main.c | 6 |
1 files 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 <b>conn</b> 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 <b>conn</b> of any write events. */ |