Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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