Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core.macosx/library/exec_unix.c')
-rw-r--r--core/org.eclipse.cdt.core.macosx/library/exec_unix.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core.macosx/library/exec_unix.c b/core/org.eclipse.cdt.core.macosx/library/exec_unix.c
index 4b06d7b827..0d68dd13c0 100644
--- a/core/org.eclipse.cdt.core.macosx/library/exec_unix.c
+++ b/core/org.eclipse.cdt.core.macosx/library/exec_unix.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002 - 2011 QNX Software Systems and others.
+ * Copyright (c) 2002, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,8 @@
*
* Contributors:
* QNX Software Systems - initial API and implementation
+ * Wind River Systems, Inc.
+ * Mikhail Sennikovsky - bug 145737
*******************************************************************************/
#include "exec0.h"
#include <unistd.h>
@@ -18,7 +20,7 @@
#include <stdlib.h>
/* from pfind.c */
-extern char *pfind(const char *name, char *const envp[]);
+extern char *pfind(const char *name, char * const envp[]);
pid_t
exec0(const char *path, char *const argv[], char *const envp[],
@@ -90,6 +92,8 @@ exec0(const char *path, char *const argv[], char *const envp[],
close(fd++);
}
+ setpgid(getpid(), getpid());
+
if (envp[0] == NULL) {
execv(full_path, argv);
} else {
@@ -134,9 +138,18 @@ int wait0(pid_t pid)
int status;
int val = -1;
- if (pid < 0 || waitpid(pid, &status, 0) < 0)
+ if (pid < 0)
return -1;
-
+
+ for (;;) {
+ if (waitpid(pid, &status, 0) < 0) {
+ if (errno == EINTR) {
+ // interrupted system call - retry
+ continue;
+ }
+ }
+ break;
+ }
if (WIFEXITED(status)) {
val = WEXITSTATUS(status);
}

Back to the top