]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: getppid() is not supported.
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 30 Sep 2014 13:11:58 +0000 (06:11 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 30 Sep 2014 13:11:58 +0000 (06:11 -0700)
The PID and thus parent process PID concept is not available in Windows
and MinGW at least lacks the API mechanism.

This may re-open an issue with kid processes notifying the coordinator
when they are shutting down. If so we need to find an alternative
mechanism to replace this use of kill(getppid(), SIGUSR1)

src/main.cc

index a6fc96c2fe470fd0cd69d44bebdfe58da164185b..152900196a278717eca7f70e365387466d658fd4 100644 (file)
@@ -620,13 +620,12 @@ shut_down(int sig)
 {
     do_shutdown = sig == SIGINT ? -1 : 1;
     ShutdownSignal = sig;
-#ifdef SIGTTIN
-
+#if defined(SIGTTIN)
     if (SIGTTIN == sig)
         shutdown_status = 1;
-
 #endif
 
+#if !_SQUID_WINDOWS_
     const pid_t ppid = getppid();
 
     if (!IamMasterProcess() && ppid > 1) {
@@ -636,17 +635,15 @@ shut_down(int sig)
                    " pid " << ppid << ": " << xstrerror());
     }
 
-#if !_SQUID_WINDOWS_
 #if KILL_PARENT_OPT
-
     if (!IamMasterProcess() && ppid > 1) {
         debugs(1, DBG_IMPORTANT, "Killing master process, pid " << ppid);
 
         if (kill(ppid, sig) < 0)
             debugs(1, DBG_IMPORTANT, "kill " << ppid << ": " << xstrerror());
     }
-
 #endif /* KILL_PARENT_OPT */
+
 #if SA_RESETHAND == 0
     signal(SIGTERM, SIG_DFL);