Return-Path: Delivered-To: apmail-apr-cvs-archive@www.apache.org Received: (qmail 75094 invoked from network); 10 Apr 2004 21:29:53 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 10 Apr 2004 21:29:53 -0000 Received: (qmail 455 invoked by uid 500); 10 Apr 2004 21:29:40 -0000 Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 420 invoked by uid 500); 10 Apr 2004 21:29:40 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 407 invoked from network); 10 Apr 2004 21:29:40 -0000 Date: 10 Apr 2004 21:29:52 -0000 Message-ID: <20040410212952.75085.qmail@minotaur.apache.org> From: trawick@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/poll/unix poll.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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)); }