mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
waitfor was return the pid instead of the exit value.
This commit is contained in:
parent
86bd4ef30a
commit
5e4385b1c3
1 changed files with 11 additions and 2 deletions
|
@ -224,8 +224,17 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise
|
||||||
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor
|
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor
|
||||||
(JNIEnv * env, jobject proc, jint pid)
|
(JNIEnv * env, jobject proc, jint pid)
|
||||||
{
|
{
|
||||||
int stat_loc;
|
int ret;
|
||||||
return (waitpid(pid, &stat_loc, WEXITED));
|
int val = -1;
|
||||||
|
|
||||||
|
ret = waitpid(pid, &stat_loc, WEXITED);
|
||||||
|
if (ret == -1 && errno == EINTR) {
|
||||||
|
// Throw an exception here.
|
||||||
|
}
|
||||||
|
if (WIFEXITED(stat_loc)) {
|
||||||
|
val = WEXITSTATUS(stat_loc);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue