summaryrefslogtreecommitdiff
path: root/poll
diff options
context:
space:
mode:
authorbrianp <brianp@13f79535-47bb-0310-9956-ffa450edef68>2005-11-26 03:42:46 +0000
committerbrianp <brianp@13f79535-47bb-0310-9956-ffa450edef68>2005-11-26 03:42:46 +0000
commit6d95c36cf7f3d661ecdafdde2a549c70198a1fb5 (patch)
tree7dbf5927a8ec6114da901aa7e7941c76b4d5e29c /poll
parente910f9244d045b7c27f618f7f050fe82b413256c (diff)
downloadlibapr-6d95c36cf7f3d661ecdafdde2a549c70198a1fb5.tar.gz
Correctly compute number of signalled descriptors in the select(2)-based
implementation of apr_poll() when one or more descriptors has multiple events (e.g., is both readable and writable). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@349070 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r--poll/unix/select.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/poll/unix/select.c b/poll/unix/select.c
index 0392d07b7..a64ddbad9 100644
--- a/poll/unix/select.c
+++ b/poll/unix/select.c
@@ -131,6 +131,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num,
return apr_get_netos_error();
}
+ (*nsds) = 0;
for (i = 0; i < num; i++) {
apr_os_sock_t fd;
@@ -156,6 +157,9 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, int num,
if (FD_ISSET(fd, &exceptset)) {
aprset[i].rtnevents |= APR_POLLERR;
}
+ if (aprset[i].rtnevents) {
+ (*nsds)++;
+ }
}
return APR_SUCCESS;