- API: fix Unix bug when checking if client is alive based on PID.

Can't use waitpid() here; works only for children.
    Use kill(pid, 0) instead.
This commit is contained in:
David Anderson 2012-12-27 23:44:19 -08:00 committed by Oliver Bock
parent d0de3776bd
commit be553882bd
2 changed files with 10 additions and 1 deletions

View File

@ -395,7 +395,8 @@ static bool client_dead() {
}
return true;
#else
return (waitpid(aid.client_pid, 0, WNOHANG) < 0);
int retval = kill(aid.client_pid, 0);
return (retval == -1 && errno == ESRCH);
#endif
} else {
return (interrupt_count > heartbeat_giveup_count);

View File

@ -7928,3 +7928,11 @@ David 27 Dec 2012
client/
hostinfo_unix.cpp
hostinfo_unix_test.cpp
David 27 Dec 2012
- API: fix Unix bug when checking if client is alive based on PID.
Can't use waitpid() here; works only for children.
Use kill(pid, 0) instead.
api/
boinc_api.cpp