Use _spawnvp to replace fork for non-Unix platforms.
diff --git a/configure b/configure index f57035c..0aac349 100755 --- a/configure +++ b/configure
@@ -13248,11 +13248,13 @@ + for ac_func in \ _lwp_create \ _pclose \ _popen \ _snprintf \ + _spawnvp \ _stricmp \ _strnicmp \ _vsnprintf \
diff --git a/configure.ac b/configure.ac index b505500..8eb46ee 100644 --- a/configure.ac +++ b/configure.ac
@@ -946,6 +946,7 @@ _pclose \ _popen \ _snprintf \ + _spawnvp \ _stricmp \ _strnicmp \ _vsnprintf \
diff --git a/include/config.h.in b/include/config.h.in index aae9d7b..65062d8 100644 --- a/include/config.h.in +++ b/include/config.h.in
@@ -686,6 +686,9 @@ /* Define to 1 if you have the `_snprintf' function. */ #undef HAVE__SNPRINTF +/* Define to 1 if you have the `_spawnvp' function. */ +#undef HAVE__SPAWNVP + /* Define to 1 if you have the `_stricmp' function. */ #undef HAVE__STRICMP
diff --git a/tools/winegcc.c b/tools/winegcc.c index 0e07679..f51533a 100644 --- a/tools/winegcc.c +++ b/tools/winegcc.c
@@ -75,6 +75,9 @@ void spawn(char *const argv[]) { +#ifdef HAVE__SPAWNVP + if (!_spawnvp( _P_WAIT, argv[0], argv)) return; +#else int pid, status, wret, i; if (verbose) @@ -92,6 +95,8 @@ if (pid == wret && WIFEXITED(status) && WEXITSTATUS(status) == 0) return; error("%s failed.", argv[0]); } +#endif /* HAVE__SPAWNVP */ + perror("Error:"); exit(3); }
diff --git a/tools/winewrap.c b/tools/winewrap.c index 1b6b26e..c6ff67c 100644 --- a/tools/winewrap.c +++ b/tools/winewrap.c
@@ -296,6 +296,9 @@ void spawn(char *const argv[]) { +#ifdef HAVE__SPAWNVP + if (!_spawnvp( _P_WAIT, argv[0], argv)) return; +#else int pid, status, wret, i; if (verbose) @@ -313,6 +316,8 @@ if (pid == wret && WIFEXITED(status) && WEXITSTATUS(status) == 0) return; error("%s failed.", argv[0]); } +#endif /* HAVE__SPAWNVP */ + perror("Error:"); exit(3); } @@ -675,7 +680,7 @@ /* create the loader script */ create_file(base_file, app_loader_script, base_name); - chmod(base_file, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); + chmod(base_file, 0755); return 0; }