From be32b3413c2245dab21e03bb0cb5c107f68f2eb3 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 19 Nov 2007 14:57:27 +0100 Subject: [PATCH] libport: Work around Mac OS execve() breakage. --- libs/port/spawn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/port/spawn.c b/libs/port/spawn.c index 832862c350..490abb30ac 100644 --- a/libs/port/spawn.c +++ b/libs/port/spawn.c @@ -23,6 +23,7 @@ #include #include +#include #ifdef HAVE_SYS_WAIT_H #include #endif @@ -41,7 +42,8 @@ int spawnvp(int mode, const char *cmdname, const char *const argv[]) if (mode == _P_OVERLAY) { execvp(cmdname, (char **)argv); - return -1; /* if we get here it failed */ + /* if we get here it failed */ + if (errno != ENOTSUP) return -1; /* exec fails on MacOS if the process has multiple threads */ } dfl_act.sa_handler = SIG_DFL; @@ -58,6 +60,8 @@ int spawnvp(int mode, const char *cmdname, const char *const argv[]) _exit(1); } + if (pid != -1 && mode == _P_OVERLAY) exit(0); + if (pid != -1 && mode == _P_WAIT) { while (pid != (wret = waitpid(pid, &status, 0))) -- 2.32.0.93.g670b81a890