]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From: "Michael O'Reilly" <michael@metal.iinet.net.au>
authorwessels <>
Sat, 3 Jan 1998 01:15:32 +0000 (01:15 +0000)
committerwessels <>
Sat, 3 Jan 1998 01:15:32 +0000 (01:15 +0000)
here's a patch to fix it. (The threads library is closing FD 0 for
some reason on the fork(). It's a bug in the threads library, but this
is a work around.. )

src/dns.cc

index aa4c3e72879722dcdebb582133bbdc182cab4498..d497416043d26296d9fa97e177f971beafc2b51f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dns.cc,v 1.46 1997/11/23 06:52:37 wessels Exp $
+ * $Id: dns.cc,v 1.47 1998/01/02 18:15:32 wessels Exp $
  *
  * DEBUG: section 34    Dnsserver interface
  * AUTHOR: Harvest Derived
@@ -196,7 +196,13 @@ dnsOpenServer(const char *command)
     dup2(fd, 1);
     dup2(fileno(debug_log), 2);
     fclose(debug_log);
-    close(fd);
+    /*
+     * Solaris pthreads seems to close FD 0 upon fork(), so don't close
+     * this FD if its 0, 1, or 2.
+     * -- Michael O'Reilly <michael@metal.iinet.net.au>
+     */
+    if (fd > 2)
+        close(fd);
     close(cfd);
     if (Config.onoff.res_defnames)
        execlp(command, "(dnsserver)", "-D", NULL);