From: wessels <> Date: Sat, 23 Mar 1996 03:56:36 +0000 (+0000) Subject: close all FD at startup X-Git-Tag: SQUID_3_0_PRE1~6406 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=464299b372c128a94086bd375fa24a970302b033;p=thirdparty%2Fsquid.git close all FD at startup --- diff --git a/src/main.cc b/src/main.cc index 551560f37b..94a7c21717 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,4 +1,4 @@ -/* $Id: main.cc,v 1.4 1996/03/22 17:47:40 wessels Exp $ */ +/* $Id: main.cc,v 1.5 1996/03/22 20:56:36 wessels Exp $ */ #include "config.h" #include @@ -87,6 +87,9 @@ int main(argc, argv) cached_starttime = cached_curtime = time((time_t *) NULL); failure_notify = fatal_dump; + for (n = getMaxFD(); n > 2; n--) + close(n); + /* try to use as many file descriptors as possible */ /* System V uses RLIMIT_NOFILE and BSD uses RLIMIT_OFILE */ #if defined(HAVE_SETRLIMIT)