Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2002-10-16 08:11:04 -0400
committerDavid Inglis2002-10-16 08:11:04 -0400
commite6b8733adac0442e95bbb11ff49efc61f963d13e (patch)
treec8bc8ae80f7229c31af080ea176f7d5f3aed3dd6 /core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c
parentfb2a003ba6923f19b5a559f76090da008f3c8a6b (diff)
downloadorg.eclipse.cdt-e6b8733adac0442e95bbb11ff49efc61f963d13e.tar.gz
org.eclipse.cdt-e6b8733adac0442e95bbb11ff49efc61f963d13e.tar.xz
org.eclipse.cdt-e6b8733adac0442e95bbb11ff49efc61f963d13e.zip
patch from Alex Chapiro
Diffstat (limited to 'core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c')
-rw-r--r--core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c b/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c
index 7c8b1f04203..7c56f2fb55d 100644
--- a/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c
+++ b/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c
@@ -22,6 +22,7 @@
#include "jni.h"
#include "io.h"
+// #define DEBUG_MONITOR
#define PIPE_SIZE 512
#define MAX_CMD_SIZE 1024
@@ -491,7 +492,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise
case SIG_KILL:
case SIG_TERM:
#ifdef DEBUG_MONITOR
- sprintf(buffer, "Spawner received KILL or TERM signal for process %i\n", pid);
+ sprintf(buffer, "Spawner received KILL or TERM signal for process %i\n", pCurProcInfo -> pid);
OutputDebugString(buffer);
#endif
SetEvent(pCurProcInfo -> eventTerminate);
@@ -677,18 +678,20 @@ unsigned int _stdcall waitProcTermination(void* pv)
#endif
}
-
for(i = 0; i < MAX_PROCS; ++i)
{
if(pInfo[i].pid == pid)
{
+ if(WaitForSingleObject(pInfo[i].eventWait, 1) == WAIT_OBJECT_0) // Correct finish
+ {
#ifdef DEBUG_MONITOR
- sprintf(buffer, "waitProcTermination: set PID %i to 0\n", pid, GetLastError());
- OutputDebugString(buffer);
+ sprintf(buffer, "waitProcTermination: set PID %i to 0\n", pid, GetLastError());
+ OutputDebugString(buffer);
#endif
- cleanUpProcBlock(pInfo + i);
+ cleanUpProcBlock(pInfo + i);
+ }
break;
- }
+ } // Otherwise failed because was not started
}
CloseHandle(hProc);

Back to the top