You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bj...@hyperreal.org on 1999/10/18 16:53:27 UTC

cvs commit: apache-2.0/src/lib/apr/network_io/os2 poll.c

bjh         99/10/18 07:53:25

  Modified:    src/lib/apr/network_io/os2 poll.c
  Log:
  OS/2: Fix ap_get_revents() so it actually works.
  
  Revision  Changes    Path
  1.6       +11 -11    apache-2.0/src/lib/apr/network_io/os2/poll.c
  
  Index: poll.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/os2/poll.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- poll.c	1999/10/18 11:36:04	1.5
  +++ poll.c	1999/10/18 14:53:24	1.6
  @@ -177,18 +177,18 @@
   {
       int i;
       
  -    for (i=0; i < aprset->num_total && aprset->socket_list[i] != sock->socketdes; i++);
  +    *event = 0;
       
  -    if (i == aprset->num_total) {
  -        return APR_INVALSOCK;
  -    } 
  -    
  -    if (i < aprset->num_read)
  -        *event = APR_POLLIN;
  -    else if (i < aprset->num_read + aprset->num_write)
  -        *event = APR_POLLOUT;
  -    else
  -        *event = APR_POLLPRI;
  +    for (i=0; i < aprset->num_total; i++) {
  +        if (aprset->socket_list[i] == sock->socketdes && aprset->r_socket_list[i] > 0) {
  +            if (i < aprset->num_read)
  +                *event |= APR_POLLIN;
  +            else if (i < aprset->num_read + aprset->num_write)
  +                *event |= APR_POLLOUT;
  +            else
  +                *event |= APR_POLLPRI;
  +        }
  +    }
   
       return APR_SUCCESS;
   }