INN commit: trunk/innd (innd.c)
INN Commit
rra at isc.org
Tue Jul 12 13:04:09 UTC 2011
Date: Tuesday, July 12, 2011 @ 06:04:09
Author: iulius
Revision: 9244
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:
trunk/innd/innd.c
--------+
innd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Modified: innd.c
===================================================================
--- innd.c 2011-07-12 12:59:21 UTC (rev 9243)
+++ innd.c 2011-07-12 13:04:09 UTC (rev 9244)
@@ -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