From: Amos Jeffries Date: Tue, 30 Sep 2014 13:11:58 +0000 (-0700) Subject: Windows: getppid() is not supported. X-Git-Tag: SQUID_3_5_0_1~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d75df34ab9ebdaeab4e7f670cee22a1afc344b56;p=thirdparty%2Fsquid.git Windows: getppid() is not supported. 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) --- diff --git a/src/main.cc b/src/main.cc index a6fc96c2fe..152900196a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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);