]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polishing touches meant to be included in r15206.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 19 Jun 2017 00:33:39 +0000 (18:33 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 19 Jun 2017 00:33:39 +0000 (18:33 -0600)
src/main.cc

index 49629641022f07fd91d466acad69cbf5baa0e88d..6f3e321f578e19234c3a8cf91fd7bcaae175c08b 100644 (file)
@@ -1799,7 +1799,10 @@ masterSignaled()
     return (DebugSignal > 0 || RotateSignal > 0 || ReconfigureSignal > 0 || ShutdownSignal > 0);
 }
 
-static void GoIntoBackground()
+#if !_SQUID_WINDOWS_
+/// makes the caller a daemon process running in the background
+static void
+GoIntoBackground()
 {
     pid_t pid;
     if ((pid = fork()) < 0) {
@@ -1810,14 +1813,15 @@ static void GoIntoBackground()
         // parent
         exit(EXIT_SUCCESS);
     }
+    // child, running as a background daemon (or a failed-to-fork parent)
 }
+#endif /* !_SQUID_WINDOWS_ */
 
 static void
 watch_child(char *argv[])
 {
 #if !_SQUID_WINDOWS_
     char *prog;
-    PidStatus status;
     pid_t pid;
 #ifdef TIOCNOTTY
 
@@ -1945,6 +1949,7 @@ watch_child(char *argv[])
         int waitFlag = 0;
         if (masterSignaled())
             waitFlag = WNOHANG;
+        PidStatus status;
         pid = WaitForAnyPid(status, waitFlag);
 
         // check for a stopped kid