From: Marcos Mello Date: Thu, 25 Feb 2016 01:52:52 +0000 (+1300) Subject: Bug 4450: wait() related cleanup X-Git-Tag: SQUID_4_0_8~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7def3bebf3a2a97940ecb642fc2c102476de7ce9;p=thirdparty%2Fsquid.git Bug 4450: wait() related cleanup --- diff --git a/src/store/Controller.cc b/src/store/Controller.cc index e5c988e401..1e9401418a 100644 --- a/src/store/Controller.cc +++ b/src/store/Controller.cc @@ -76,21 +76,11 @@ Store::Controller::create() swapDir->create(); #if !_SQUID_WINDOWS_ - pid_t pid; - do { - int status; -#if _SQUID_NEXT_ - - pid = wait3(&status, WNOHANG, NULL); -#else - - pid = waitpid(-1, &status, 0); -#endif - + PidStatus status; + pid = WaitForAnyPid(status, WNOHANG); } while (pid > 0 || (pid < 0 && errno == EINTR)); - #endif } diff --git a/src/tools.cc b/src/tools.cc index a21d7f2e2f..954e5864a1 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1204,7 +1204,7 @@ WaitForOnePid(pid_t pid, PidStatus &status, int flags) #if _SQUID_NEXT_ if (pid < 0) return wait3(&status, flags, NULL); - return wait4(cpid, &status, flags, NULL); + return wait4(pid, &status, flags, NULL); #elif _SQUID_WINDOWS_ return 0; // function not used on Windows #else