Re: Close() in daemon loop

From: Robert Collins <robert.collins@dont-contact.us>
Date: Fri, 7 Jul 2000 08:27:59 +1000

A little more: further up in main, there is a loop:

   if (opt_catch_signals)
       for (n = Squid_MaxFD; n > 2; n--)
           close(n);

My question is: why does this (very similar) loop stop at 3, and the other
start at 0, instead of 3?

Rob

----- Original Message -----
From: "Robert Collins" <robert.collins@itdomain.com.au>
To: <squid-dev@squid-cache.org>
Sent: Friday, July 07, 2000 8:20 AM
Subject: Close() in daemon loop

> In watch_child(), just before it launches the very first daemon, squid
goes
> thru the following loop
>
> for (i = 0; i < Squid_MaxFD; i++)
> close(i);
>
> for (;;) {
> mainStartScript(argv[0]);
> if ((pid = fork()) == 0) {
> /* child */
>
> Is there any design reason that squid can't check to see if it is open
> before calling close()?
> The reason for asking is a problem on cygwin (1.1.3s) where it's
> stackdumping when i=2. I'm following up the stackdump with the cygwin
> developers.
>
> TIA
> Rob
>
>
Received on Thu Jul 06 2000 - 16:23:33 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:31 MST