]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
maxfd bugs when we run out of files?
authorwessels <>
Wed, 3 Dec 1997 16:05:00 +0000 (16:05 +0000)
committerwessels <>
Wed, 3 Dec 1997 16:05:00 +0000 (16:05 +0000)
test-suite/tcp-banger2.c

index e9e236d89c0b66e104cc9a6b2e28270898d8d443..2e4639fbab090af47db40644cdbf2873175451f7 100644 (file)
@@ -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;