--------------------- PatchSet 443 Date: 2000/07/16 00:21:09 Author: hno Branch: hno-devel Tag: (none) Log: Minor rearrangement to protect the daemon stdio change from when the process is started without any stdin/stdout/stderr Members: src/main.c:1.1.1.3.10.3.2.5->1.1.1.3.10.3.2.6 Index: squid/src/main.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/main.c,v retrieving revision 1.1.1.3.10.3.2.5 retrieving revision 1.1.1.3.10.3.2.6 diff -u -r1.1.1.3.10.3.2.5 -r1.1.1.3.10.3.2.6 --- squid/src/main.c 16 Jul 2000 00:06:58 -0000 1.1.1.3.10.3.2.5 +++ squid/src/main.c 16 Jul 2000 00:21:09 -0000 1.1.1.3.10.3.2.6 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.1.1.3.10.3.2.5 2000/07/16 00:06:58 hno Exp $ + * $Id: main.c,v 1.1.1.3.10.3.2.6 2000/07/16 00:21:09 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -846,15 +846,14 @@ close(i); } #endif - for (i = 3; i < Squid_MaxFD; i++) - close(i); nullfd = open("/dev/null", O_RDWR); dup2(nullfd, 0); if (!opt_debug_stderr) { dup2(nullfd, 1); dup2(nullfd, 2); } - close(nullfd); + for (i = 3; i < Squid_MaxFD; i++) + close(i); for (;;) { mainStartScript(argv[0]); if ((pid = fork()) == 0) {