[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mingw and execute vs. posix_spawn
From: |
Bruno Haible |
Subject: |
Re: mingw and execute vs. posix_spawn |
Date: |
Fri, 6 Mar 2009 14:29:23 +0100 |
User-agent: |
KMail/1.9.9 |
Eric Blake wrote:
> * lib/execute.c (execute) [_MSC_VER || __MINGW32__]: Avoid
> compiler warning about incompatible types.
> * lib/pipe.c (create_pipe) [_MSC_VER || __MINGW32__]: Likewise.
Applied as follows:
2009-03-06 Eric Blake <address@hidden>
* lib/execute.c (execute) [WIN32_NATIVE]: Cast arguments of spawnvpe,
to avoid compiler warnings.
* lib/pipe.c (create_pipe) [WIN32_NATIVE]: Likewise.
--- lib/execute.c.orig 2009-03-06 14:28:18.000000000 +0100
+++ lib/execute.c 2009-03-06 14:24:51.000000000 +0100
@@ -154,14 +154,16 @@
copy of the environment block - ignoring the effects of putenv() and
[un]setenv(). */
{
- exitcode = spawnvpe (P_WAIT, prog_path, prog_argv, environ);
+ exitcode = spawnvpe (P_WAIT, prog_path, (const char **) prog_argv,
+ (const char **) environ);
if (exitcode < 0 && errno == ENOEXEC)
{
/* prog is not an native executable. Try to execute it as a
shell script. Note that prepare_spawn() has already prepended
a hidden element "sh.exe" to prog_argv. */
--prog_argv;
- exitcode = spawnvpe (P_WAIT, prog_argv[0], prog_argv, environ);
+ exitcode = spawnvpe (P_WAIT, prog_argv[0], (const char **) prog_argv,
+ (const char **) environ);
}
}
if (nulloutfd >= 0)
--- lib/pipe.c.orig 2009-03-06 14:28:18.000000000 +0100
+++ lib/pipe.c 2009-03-06 14:24:51.000000000 +0100
@@ -195,14 +195,16 @@
copy of the environment block - ignoring the effects of putenv() and
[un]setenv(). */
{
- child = spawnvpe (P_NOWAIT, prog_path, prog_argv, environ);
+ child = spawnvpe (P_NOWAIT, prog_path, (const char **) prog_argv,
+ (const char **) environ);
if (child < 0 && errno == ENOEXEC)
{
/* prog is not an native executable. Try to execute it as a
shell script. Note that prepare_spawn() has already prepended
a hidden element "sh.exe" to prog_argv. */
--prog_argv;
- child = spawnvpe (P_NOWAIT, prog_argv[0], prog_argv, environ);
+ child = spawnvpe (P_NOWAIT, prog_argv[0], (const char **) prog_argv,
+ (const char **) environ);
}
}
if (stdinfd >= 0)