1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

waitfor was return the pid instead of the exit value.

This commit is contained in:
Alain Magloire 2002-11-12 14:53:07 +00:00
parent 86bd4ef30a
commit 5e4385b1c3

View file

@ -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
(JNIEnv * env, jobject proc, jint pid)
{
int stat_loc;
return (waitpid(pid, &stat_loc, WEXITED));
int ret;
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;
}