From a1f3ffc860da4cb45300b1c80c74c20425b2793b Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Thu, 29 Aug 2024 11:21:46 +0200 Subject: [PATCH] Make it so the test harness closes fds up to 100, not only 10 Some tests require that there be no fds open up to fd 100, whereas currently the test harness only closes fds up to 10. This means on an environment where there is an fd between 10 and 100 open (e.g. on my Plasma/KDE system every shell session had fd 95 open for some reason) such tests will fail. This patch fixes this by making it so the test harness closes fds 10 to 100. Signed-off-by: Gabriel Ravier --- libc/testlib/testmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/testlib/testmain.c b/libc/testlib/testmain.c index 083a2daa2..55d34f80f 100644 --- a/libc/testlib/testmain.c +++ b/libc/testlib/testmain.c @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) { __log_level = kLogInfo; GetOpts(argc, argv); - for (fd = 3; fd < 10; ++fd) { + for (fd = 3; fd < 100; ++fd) { close(fd); }