From 6c42a3fff7bfe5c3ff6e410179e1fb6cbb8b8ba2 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 25 Mar 2014 13:14:45 -0400 Subject: [PATCH] LIB: Possible fix for process_exists() on Linux. Newer versions of Linux appear to have stricter parameter validation requirements for waitpid(). --- lib/util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/util.cpp b/lib/util.cpp index c38deae9f9..75da9c18e4 100644 --- a/lib/util.cpp +++ b/lib/util.cpp @@ -491,7 +491,8 @@ int get_exit_status(int pid) { return status; } bool process_exists(int pid) { - int p = waitpid(pid, 0, WNOHANG); + int status; + int p = waitpid(pid, &status, WNOHANG); if (p == pid) return false; // process has exited if (p == -1) return false; // PID doesn't exist return true;