mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
Bug 525705 - Fix Spawner.waitFor(pid) returning prematurely
On Windows XP, waitFor(pid) would return -1 immediately instead of waiting for the process to exit. This caused starting a debug session to be stuck at "Initializing debugger services 62%" because the GDB it was trying to talk to was terminated immediately after being started. Binaries built with MSVC10 tools and `nmake /f Makefile_x86_64.mk /NOLOGO spawner`. Change-Id: I532f63c7a5facdf867ed94945b0cd26b4177c3bd Signed-off-by: Christian Walther <walther@indel.ch>
This commit is contained in:
parent
55245c4252
commit
c6abbfb6d3
3 changed files with 3 additions and 3 deletions
Binary file not shown.
Binary file not shown.
|
@ -669,7 +669,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise
|
|||
OutputDebugStringW(buffer);
|
||||
#endif
|
||||
|
||||
hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, pCurProcInfo -> pid);
|
||||
hProc = OpenProcess(SYNCHRONIZE, 0, pCurProcInfo -> pid);
|
||||
|
||||
if(NULL == hProc)
|
||||
return -1;
|
||||
|
@ -740,7 +740,7 @@ extern "C"
|
|||
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor
|
||||
(JNIEnv * env, jobject process, jint uid)
|
||||
{
|
||||
DWORD exit_code;
|
||||
DWORD exit_code = -1;
|
||||
int what=0;
|
||||
HANDLE hProc;
|
||||
pProcInfo_t pCurProcInfo = findProcInfo(uid);
|
||||
|
@ -748,7 +748,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor
|
|||
if(NULL == pCurProcInfo)
|
||||
return -1;
|
||||
|
||||
hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, pCurProcInfo -> pid);
|
||||
hProc = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION, 0, pCurProcInfo -> pid);
|
||||
|
||||
if(NULL == hProc)
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue