Commit c45bbad3 authored by Alexandre Julliard's avatar Alexandre Julliard

Use _spawnvp to replace fork for non-Unix platforms.

parent 55776370
......@@ -13248,11 +13248,13 @@ fi
for ac_func in \
_lwp_create \
_pclose \
_popen \
_snprintf \
_spawnvp \
_stricmp \
_strnicmp \
_vsnprintf \
......
......@@ -946,6 +946,7 @@ AC_CHECK_FUNCS(\
_pclose \
_popen \
_snprintf \
_spawnvp \
_stricmp \
_strnicmp \
_vsnprintf \
......
......@@ -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
......
......@@ -75,6 +75,9 @@ char *strmake(const char *fmt, ...)
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 @@ void spawn(char *const argv[])
if (pid == wret && WIFEXITED(status) && WEXITSTATUS(status) == 0) return;
error("%s failed.", argv[0]);
}
#endif /* HAVE__SPAWNVP */
perror("Error:");
exit(3);
}
......
......@@ -296,6 +296,9 @@ void create_file(const char *name, const char *fmt, ...)
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 @@ void spawn(char *const argv[])
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 @@ int main(int argc, char **argv)
/* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment