Module: wine Branch: master Commit: be32b3413c2245dab21e03bb0cb5c107f68f2eb3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=be32b3413c2245dab21e03bb0c...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Nov 19 14:57:27 2007 +0100
libport: Work around Mac OS execve() breakage.
---
libs/port/spawn.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libs/port/spawn.c b/libs/port/spawn.c index 832862c..490abb3 100644 --- a/libs/port/spawn.c +++ b/libs/port/spawn.c @@ -23,6 +23,7 @@
#include <errno.h> #include <signal.h> +#include <stdlib.h> #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> #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)))