From: wessels <> Date: Wed, 3 Dec 1997 16:05:00 +0000 (+0000) Subject: maxfd bugs when we run out of files? X-Git-Tag: SQUID_3_0_PRE1~4399 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aeb649da213ff280b55895af5c7a8708be544212;p=thirdparty%2Fsquid.git maxfd bugs when we run out of files? --- diff --git a/test-suite/tcp-banger2.c b/test-suite/tcp-banger2.c index e9e236d89c..2e4639fbab 100644 --- a/test-suite/tcp-banger2.c +++ b/test-suite/tcp-banger2.c @@ -124,7 +124,7 @@ fd_close(int fd) FD[fd].data = NULL; nfds--; if (fd == maxfd) { - while (FD[fd].cb == NULL) + while (fd > 0 && FD[fd].cb == NULL) fd--; maxfd = fd; } @@ -292,6 +292,7 @@ main(argc, argv) FD_SET(i, &R); } if (select(maxfd + 1, &R, NULL, NULL, &to) < 0) { + printf("maxfd=%d\n", maxfd); if (errno != EINTR) perror("select"); continue;