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/01/30 13:33:46 UTC
cvs commit: apr/poll/unix poll.c
trawick 2004/01/30 04:33:46
Modified: . CHANGES
poll/unix poll.c
Log:
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
Reviewed and fixed by: Brad Nicholes
Revision Changes Path
1.449 +4 -0 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.448
retrieving revision 1.449
diff -u -r1.448 -r1.449
--- CHANGES 29 Dec 2003 21:03:49 -0000 1.448
+++ CHANGES 30 Jan 2004 12:33:46 -0000 1.449
@@ -7,6 +7,10 @@
Changes with APR 1.0
+ *) 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]
+
*) new error status APR_STATUS_IS_ENOTENOUGHENTROPY, Doxygen fixes
[Sander Temme <sander at temme dot net]
1.43 +12 -0 apr/poll/unix/poll.c
Index: poll.c
===================================================================
RCS file: /home/cvs/apr/poll/unix/poll.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- poll.c 22 Nov 2003 10:53:46 -0000 1.42
+++ poll.c 30 Jan 2004 12:33:46 -0000 1.43
@@ -248,6 +248,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);
}
@@ -425,6 +431,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));
}