Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2002-11-12 14:53:07 +0000
committerAlain Magloire2002-11-12 14:53:07 +0000
commit5e4385b1c3e247570827112c7a4f94e078552c8c (patch)
tree92acd12d8b09b52c9c53e8f8e011a7dda81146fd /core/org.eclipse.cdt.core.qnx
parent86bd4ef30ad7b181f2d19a6544b2eced8ab63895 (diff)
downloadorg.eclipse.cdt-5e4385b1c3e247570827112c7a4f94e078552c8c.tar.gz
org.eclipse.cdt-5e4385b1c3e247570827112c7a4f94e078552c8c.tar.xz
org.eclipse.cdt-5e4385b1c3e247570827112c7a4f94e078552c8c.zip
waitfor was return the pid instead of the exit value.
Diffstat (limited to 'core/org.eclipse.cdt.core.qnx')
-rw-r--r--core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c b/core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c
index 8850044487..a6c1cef581 100644
--- a/core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c
+++ b/core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c
@@ -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;
}

Back to the top