mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 02:35:37 +02:00
patch from Alex Chapiro
This commit is contained in:
parent
fb2a003ba6
commit
e6b8733ada
2 changed files with 9 additions and 6 deletions
|
@ -22,6 +22,7 @@
|
||||||
#include "jni.h"
|
#include "jni.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
|
// #define DEBUG_MONITOR
|
||||||
|
|
||||||
#define PIPE_SIZE 512
|
#define PIPE_SIZE 512
|
||||||
#define MAX_CMD_SIZE 1024
|
#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_KILL:
|
||||||
case SIG_TERM:
|
case SIG_TERM:
|
||||||
#ifdef DEBUG_MONITOR
|
#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);
|
OutputDebugString(buffer);
|
||||||
#endif
|
#endif
|
||||||
SetEvent(pCurProcInfo -> eventTerminate);
|
SetEvent(pCurProcInfo -> eventTerminate);
|
||||||
|
@ -677,18 +678,20 @@ unsigned int _stdcall waitProcTermination(void* pv)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < MAX_PROCS; ++i)
|
for(i = 0; i < MAX_PROCS; ++i)
|
||||||
{
|
{
|
||||||
if(pInfo[i].pid == pid)
|
if(pInfo[i].pid == pid)
|
||||||
{
|
{
|
||||||
|
if(WaitForSingleObject(pInfo[i].eventWait, 1) == WAIT_OBJECT_0) // Correct finish
|
||||||
|
{
|
||||||
#ifdef DEBUG_MONITOR
|
#ifdef DEBUG_MONITOR
|
||||||
sprintf(buffer, "waitProcTermination: set PID %i to 0\n", pid, GetLastError());
|
sprintf(buffer, "waitProcTermination: set PID %i to 0\n", pid, GetLastError());
|
||||||
OutputDebugString(buffer);
|
OutputDebugString(buffer);
|
||||||
#endif
|
#endif
|
||||||
cleanUpProcBlock(pInfo + i);
|
cleanUpProcBlock(pInfo + i);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
} // Otherwise failed because was not started
|
||||||
}
|
}
|
||||||
|
|
||||||
CloseHandle(hProc);
|
CloseHandle(hProc);
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue