You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2004/04/10 23:29:52 UTC

cvs commit: apr/poll/unix poll.c

trawick     2004/04/10 14:29:52

  Modified:    .        Tag: APR_0_9_BRANCH CHANGES
               poll/unix Tag: APR_0_9_BRANCH poll.c
  Log:
  Backport this from apr 1.0-dev:
  
  Return an error instead of silently failing when apr_poll() is
  used with file descriptors >= FD_SETSIZE.  (Unix systems with
  no native poll())
  
  Submitted by: Jeff Trawick, Brad Nicholes
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.426.2.16 +4 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.426.2.15
  retrieving revision 1.426.2.16
  diff -u -r1.426.2.15 -r1.426.2.16
  --- CHANGES	4 Apr 2004 15:21:08 -0000	1.426.2.15
  +++ CHANGES	10 Apr 2004 21:29:52 -0000	1.426.2.16
  @@ -1,5 +1,9 @@
   Changes with APR 0.9.5
   
  +  *) Return an error instead of silently failing when apr_poll() is
  +     used with file descriptors >= FD_SETSIZE.  (Unix systems with
  +     no native poll())  [Jeff Trawick, Brad Nicholes]
  +
     *) Fix handling of negative numbers in apr_strtoi64() on platforms
        without strtoll.  [Joe Orton]
   
  
  
  
  No                   revision
  No                   revision
  1.38.2.2  +12 -0     apr/poll/unix/poll.c
  
  Index: poll.c
  ===================================================================
  RCS file: /home/cvs/apr/poll/unix/poll.c,v
  retrieving revision 1.38.2.1
  retrieving revision 1.38.2.2
  diff -u -r1.38.2.1 -r1.38.2.2
  --- poll.c	13 Feb 2004 09:33:51 -0000	1.38.2.1
  +++ poll.c	10 Apr 2004 21:29:52 -0000	1.38.2.2
  @@ -210,6 +210,12 @@
           else {
               break;
           }
  +#if !defined(WIN32) && !defined(NETWARE) /* socket sets handled with array of handles */
  +        if (fd >= FD_SETSIZE) {
  +            /* XXX invent new error code so application has a clue */
  +            return APR_EBADF;
  +        }
  +#endif
           if (aprset[i].reqevents & APR_POLLIN) {
               FD_SET(fd, &readset);
           }
  @@ -388,6 +394,12 @@
   #endif
   #endif
       }
  +#if !defined(WIN32) && !defined(NETWARE) /* socket sets handled with array of handles */
  +    if (fd >= FD_SETSIZE) {
  +        /* XXX invent new error code so application has a clue */
  +        return APR_EBADF;
  +    }
  +#endif
       if (descriptor->reqevents & APR_POLLIN) {
           FD_SET(fd, &(pollset->readset));
       }