mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 06:03:02 +01:00
Fixed CORE-2234: Sometimes terminated worker processes in Classic are still considered being alive.
This commit is contained in:
parent
f732b628e3
commit
8ba1e1b43b
@ -201,15 +201,16 @@ bool ISC_check_process_existence(SLONG pid)
|
||||
**************************************/
|
||||
|
||||
#ifdef WIN_NT
|
||||
const HANDLE handle = OpenProcess(PROCESS_DUP_HANDLE, FALSE, (DWORD) pid);
|
||||
const HANDLE handle = OpenProcess(SYNCHRONIZE, FALSE, (DWORD) pid);
|
||||
|
||||
if (!handle && GetLastError() != ERROR_ACCESS_DENIED)
|
||||
if (!handle)
|
||||
{
|
||||
return false;
|
||||
return (GetLastError() == ERROR_ACCESS_DENIED);
|
||||
}
|
||||
|
||||
const bool alive = (WaitForSingleObject(handle, 0) != WAIT_OBJECT_0);
|
||||
CloseHandle(handle);
|
||||
return true;
|
||||
return alive;
|
||||
#else
|
||||
return (kill((int) pid, 0) == -1 && errno == ESRCH) ? false : true;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user