]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
call setsid() early in main() so the helper programs don't
authorwessels <>
Tue, 10 Feb 1998 07:42:54 +0000 (07:42 +0000)
committerwessels <>
Tue, 10 Feb 1998 07:42:54 +0000 (07:42 +0000)
src/dnsserver.cc
src/pinger.cc
src/unlinkd.cc

index c65e26f718003c01184e0d1ecb32de9b79602808..59ad5b3db51c14f2b7f889e53681ebfdcce713de 100644 (file)
@@ -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
index bd618b254b41648553ed41ca68653578b87b9a95..aebc761aeb07c673e60c37adb52125c131aba0f1 100644 (file)
@@ -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();
index 9cb3fff303fa7feaa4a079edd0ff7d8c80604aee..936688e94fc9ec8961c2b9fa14e5bf2c8d326fa7 100644 (file)
@@ -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