> Sideeffects of this patch are a few less gcc 2.95.4 warnings, and that cyrus > will shut up about not being able to set the file handlers limit to infinity > all the time (this is useful for Linux 2.2.x; feel free to rip it out... it > was in my mods to master.c, so I left it in there). > ---- rl.rlim_cur = x; rl.rlim_max = x; - if (setrlimit(RLIMIT_NUMFDS, &rl) < 0) { + if (setrlimit(RLIMIT_NUMFDS, &rl) < 0 && x != RLIM_INFINITY) { syslog(LOG_ERR, "setrlimit: Unable to set file descriptors limit to %d: %m", x); }
- if (verbose > 1) { - r = getrlimit(RLIMIT_NUMFDS, &rl); + if (verbose > 1 && getrlimit(RLIMIT_NUMFDS, &rl) >= 0) { syslog(LOG_DEBUG, "set maximum file descriptors to %d/%d", rl.rlim_cur, rl.rlim_max); } ---- Thanks for this patch, Henrique. Can you explain what is actually causing those warnings (I get them under kernel 2.4 too)? Are they correct--is the max FD limit actually not being increase? If so, does your patch allow the max FD limit to be set correctly, or does it just quieten the warnings? Sorry I couldn't figure this out from the code--this is stuff I'm a bit unfamiliar with...