]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4450: wait() related cleanup
authorMarcos Mello <marcosfrm@gmail.com>
Thu, 25 Feb 2016 01:52:52 +0000 (14:52 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 25 Feb 2016 01:52:52 +0000 (14:52 +1300)
src/store/Controller.cc
src/tools.cc

index e5c988e401e8575d6c32de9015e5649d61a96c52..1e9401418aec2484e0d1d4c2f9e916e7a90d9069 100644 (file)
@@ -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
 }
 
index a21d7f2e2f9ab785a24a88e790b1110422965aa8..954e5864a1b2c063b83c5a9e9e85109871ca2426 100644 (file)
@@ -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