Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorChristian Walther2018-09-18 05:55:40 +0000
committerDoug Schaefer2018-09-26 20:10:31 +0000
commitc6abbfb6d31f673c7238a1d5a504d515031083ae (patch)
tree48c8c307db82d7a531699475f584426ce5408a44 /core
parent55245c425223d8db82dea3e6cb1af208fc4cbbfc (diff)
downloadorg.eclipse.cdt-c6abbfb6d31f673c7238a1d5a504d515031083ae.tar.gz
org.eclipse.cdt-c6abbfb6d31f673c7238a1d5a504d515031083ae.tar.xz
org.eclipse.cdt-c6abbfb6d31f673c7238a1d5a504d515031083ae.zip
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>
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core.win32.x86/os/win32/x86/spawner.dllbin57856 -> 57856 bytes
-rw-r--r--core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/spawner.dllbin68608 -> 68608 bytes
-rw-r--r--core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c6
3 files changed, 3 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core.win32.x86/os/win32/x86/spawner.dll b/core/org.eclipse.cdt.core.win32.x86/os/win32/x86/spawner.dll
index 3d36e1ac6df..7192bf286c2 100644
--- a/core/org.eclipse.cdt.core.win32.x86/os/win32/x86/spawner.dll
+++ b/core/org.eclipse.cdt.core.win32.x86/os/win32/x86/spawner.dll
Binary files differ
diff --git a/core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/spawner.dll b/core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/spawner.dll
index 5c30101fa1a..3dba4a71679 100644
--- a/core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/spawner.dll
+++ b/core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/spawner.dll
Binary files differ
diff --git a/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c b/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c
index c23bc32ae29..aa60b4a919b 100644
--- a/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c
+++ b/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c
@@ -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;

Back to the top