From: wessels <> Date: Sat, 3 Jan 1998 01:15:32 +0000 (+0000) Subject: From: "Michael O'Reilly" X-Git-Tag: SQUID_3_0_PRE1~4289 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55236e07e13201d6f8c934dd37f824cc6b33ca65;p=thirdparty%2Fsquid.git From: "Michael O'Reilly" 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.. ) --- diff --git a/src/dns.cc b/src/dns.cc index aa4c3e7287..d497416043 100644 --- a/src/dns.cc +++ b/src/dns.cc @@ -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 + */ + if (fd > 2) + close(fd); close(cfd); if (Config.onoff.res_defnames) execlp(command, "(dnsserver)", "-D", NULL);