Fix FD_SETSIZE comparision warnings on FreeBSD

* And again, FreeBSD sucks... it defines FD_SETSIZE as an unsigned integer,
  while every fd is signed.
  This obviously breaks thinks like assert(fd < FD_SETSIZE);


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2570 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.24
Stefan Bühler 2009-07-10 16:16:11 +00:00
parent 3c11705903
commit 2ab8287e32
3 changed files with 6 additions and 5 deletions

1
NEWS
View File

@ -11,6 +11,7 @@ NEWS
* Add server.breakagelog, a "special" stderr (fixes #1863)
* Fix config evaluation for debug.log-timeouts option (#1529)
* Add "cgi.execute-x-only" to mod_cgi, requires +x for cgi scripts (fixes #2013)
* Fix FD_SETSIZE comparision warnings
- 1.4.23 - 2009-06-19
* Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)

View File

@ -38,7 +38,7 @@ static int fdevent_select_event_add(fdevents *ev, int fde_ndx, int fd, int event
UNUSED(fde_ndx);
/* we should be protected by max-fds, but you never know */
assert(fd < FD_SETSIZE);
assert(fd < ((int)FD_SETSIZE));
if (events & FDEVENT_IN) {
FD_SET(fd, &(ev->select_set_read));

View File

@ -719,7 +719,7 @@ int main (int argc, char **argv) {
}
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
} else {
srv->max_fds = rlim.rlim_cur;
}
@ -732,7 +732,7 @@ int main (int argc, char **argv) {
#endif
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
/* don't raise the limit above FD_SET_SIZE */
if (srv->max_fds > FD_SETSIZE - 200) {
if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
log_error_write(srv, __FILE__, __LINE__, "sd",
"can't raise max filedescriptors above", FD_SETSIZE - 200,
"if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
@ -845,7 +845,7 @@ int main (int argc, char **argv) {
}
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
} else {
srv->max_fds = rlim.rlim_cur;
}
@ -859,7 +859,7 @@ int main (int argc, char **argv) {
#endif
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
/* don't raise the limit above FD_SET_SIZE */
if (srv->max_fds > FD_SETSIZE - 200) {
if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
log_error_write(srv, __FILE__, __LINE__, "sd",
"can't raise max filedescriptors above", FD_SETSIZE - 200,
"if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");