INN commit: branches/2.5/innd (innd.c)

INN Commit rra at isc.org
Sun Jul 17 19:36:59 UTC 2011


    Date: Sunday, July 17, 2011 @ 12:36:59
  Author: iulius
Revision: 9281

fix a compilation warning

Make sure FD_SETSIZE is strictly positive.  Cast for an unsigned comparison.
Fix a potential bug of affecting -1 to i in case FD_SETSIZE was 0.

Modified:
  branches/2.5/innd/innd.c

--------+
 innd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Modified: innd.c
===================================================================
--- innd.c	2011-07-17 19:36:24 UTC (rev 9280)
+++ innd.c	2011-07-17 19:36:59 UTC (rev 9281)
@@ -607,9 +607,9 @@
         sysdie("SERVER cant get file descriptor limit");
 
 #ifdef FD_SETSIZE
-    if (i > FD_SETSIZE-1) {
-        syslog(LOG_WARNING, "%s number of descriptors (%d) exceeding FD_SETSIZE-1 (%d)",
-               LogName, i, FD_SETSIZE-1);
+    if (FD_SETSIZE > 0 && (unsigned) i >= FD_SETSIZE) {
+        syslog(LOG_WARNING, "%s number of descriptors (%d) exceeding or equaling FD_SETSIZE (%d)",
+               LogName, i, FD_SETSIZE);
         i = FD_SETSIZE-1;
     }
 #endif




More information about the inn-committers mailing list