From: wessels <> Date: Tue, 10 Feb 1998 07:42:54 +0000 (+0000) Subject: call setsid() early in main() so the helper programs don't X-Git-Tag: SQUID_3_0_PRE1~4132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ac5e7caa494fa42eef81ab07e2a983fa65d0a1c;p=thirdparty%2Fsquid.git call setsid() early in main() so the helper programs don't --- diff --git a/src/dnsserver.cc b/src/dnsserver.cc index c65e26f718..59ad5b3db5 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -1,6 +1,6 @@ /* - * $Id: dnsserver.cc,v 1.42 1998/02/05 17:37:43 wessels Exp $ + * $Id: dnsserver.cc,v 1.43 1998/02/10 00:42:54 wessels Exp $ * * DEBUG: section 0 DNS Resolver * AUTHOR: Harvest Derived @@ -265,6 +265,9 @@ main(int argc, char *argv[]) int i; int c; +#if HAVE_SETSID + setsid(); +#endif safe_inet_addr("255.255.255.255", &no_addr); #if HAVE_RES_INIT diff --git a/src/pinger.cc b/src/pinger.cc index bd618b254b..aebc761aeb 100644 --- a/src/pinger.cc +++ b/src/pinger.cc @@ -1,6 +1,6 @@ /* - * $Id: pinger.cc,v 1.30 1998/02/03 04:21:19 wessels Exp $ + * $Id: pinger.cc,v 1.31 1998/02/10 00:42:55 wessels Exp $ * * DEBUG: section 42 ICMP Pinger program * AUTHOR: Duane Wessels @@ -319,6 +319,9 @@ main(int argc, char *argv[]) char *t; time_t last_check_time = 0; +#if HAVE_SETSID + setsid(); +#endif if ((t = getenv("SQUID_DEBUG"))) debug_args = xstrdup(t); getCurrentTime(); diff --git a/src/unlinkd.cc b/src/unlinkd.cc index 9cb3fff303..936688e94f 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -1,5 +1,5 @@ /* - * $Id: unlinkd.cc,v 1.17 1998/02/04 23:42:12 wessels Exp $ + * $Id: unlinkd.cc,v 1.18 1998/02/10 00:42:54 wessels Exp $ * * DEBUG: section 43 Unlink Daemon * AUTHOR: Duane Wessels @@ -59,6 +59,7 @@ main(int argc, char *argv[]) { char buf[UNLINK_BUF_LEN]; char *t; + setsid(); setbuf(stdin, NULL); while (fgets(buf, UNLINK_BUF_LEN, stdin)) { if ((t = strchr(buf, '\n'))) @@ -143,6 +144,7 @@ unlinkdClose(void) debug_trap("unlinkdClose: unlinkd_fd < 0"); return; } + debug(43, 1)("Closing unlinkd pipe on FD %d\n", unlinkd_fd); file_close(unlinkd_fd); unlinkd_fd = -1; #endif