diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 13:16:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 13:16:29 +0000 |
commit | 7a56e9e47132054fa8c527e1f6f35b6b2450f3f2 (patch) | |
tree | 3b9b72f19499ea19cf1ae981804360006c3539e0 | |
parent | 1ecee71966113d7fa0aec69161d34baf6767933e (diff) | |
download | gnunet-gtk-7a56e9e47132054fa8c527e1f6f35b6b2450f3f2.tar.gz gnunet-gtk-7a56e9e47132054fa8c527e1f6f35b6b2450f3f2.zip |
some code cleanup
-rw-r--r-- | src/lib/eventloop.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c index 9c74f12d..d1e8cd44 100644 --- a/src/lib/eventloop.c +++ b/src/lib/eventloop.c | |||
@@ -580,18 +580,21 @@ gnunet_gtk_select (void *cls, | |||
580 | GNUNET_NETWORK_fdset_zero (efds); | 580 | GNUNET_NETWORK_fdset_zero (efds); |
581 | for (i = 0; i < fd_counter; i++) | 581 | for (i = 0; i < fd_counter; i++) |
582 | { | 582 | { |
583 | int set[3]; | 583 | int set = 0; |
584 | 584 | ||
585 | if ((set[0] = (FD_ISSET (ml->cached_poll_array[i].fd, &aread) && | 585 | if ( (NULL != rfds) && |
586 | (0 != (ml->cached_poll_array[i].revents & (G_IO_IN | G_IO_HUP | G_IO_ERR)))))) | 586 | (set |= (FD_ISSET (ml->cached_poll_array[i].fd, &aread) && |
587 | (0 != (ml->cached_poll_array[i].revents & (G_IO_IN | G_IO_HUP | G_IO_ERR)))))) | ||
587 | GNUNET_NETWORK_fdset_set_native (rfds, ml->cached_poll_array[i].fd); | 588 | GNUNET_NETWORK_fdset_set_native (rfds, ml->cached_poll_array[i].fd); |
588 | if ((set[1] = (FD_ISSET (ml->cached_poll_array[i].fd, &awrite) && | 589 | if ( (NULL != wfds) && |
589 | (0 != (ml->cached_poll_array[i].revents & (G_IO_OUT | G_IO_ERR)))))) | 590 | (set |= (FD_ISSET (ml->cached_poll_array[i].fd, &awrite) && |
591 | (0 != (ml->cached_poll_array[i].revents & (G_IO_OUT | G_IO_ERR)))))) | ||
590 | GNUNET_NETWORK_fdset_set_native (wfds, ml->cached_poll_array[i].fd); | 592 | GNUNET_NETWORK_fdset_set_native (wfds, ml->cached_poll_array[i].fd); |
591 | if ((set[2] = (FD_ISSET (ml->cached_poll_array[i].fd, &aexcept) && | 593 | if ( (NULL != efds) && |
592 | (0 != (ml->cached_poll_array[i].revents & G_IO_ERR))))) | 594 | (set |= (FD_ISSET (ml->cached_poll_array[i].fd, &aexcept) && |
595 | (0 != (ml->cached_poll_array[i].revents & G_IO_ERR))))) | ||
593 | GNUNET_NETWORK_fdset_set_native (efds, ml->cached_poll_array[i].fd); | 596 | GNUNET_NETWORK_fdset_set_native (efds, ml->cached_poll_array[i].fd); |
594 | if (set[0] || set[1] || set[2]) | 597 | if (set) |
595 | result++; | 598 | result++; |
596 | } | 599 | } |
597 | #else | 600 | #else |