Skip to content

Commit

Permalink
Correctly compute number of signalled descriptors in the select(2)-based
Browse files Browse the repository at this point in the history
implementation of apr_poll() when one or more descriptors has multiple
events (e.g., is both readable and writable).


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@349070 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Brian Pane committed Nov 26, 2005
1 parent 290f3c7 commit 7181e42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions poll/unix/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 7181e42

Please sign in to comment.