mirror of https://github.com/BOINC/boinc.git
LIB: Possible fix for process_exists() on Linux. Newer versions of Linux appear to have stricter parameter validation requirements for waitpid().
This commit is contained in:
parent
292f216a6c
commit
6c42a3fff7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue