From: Eric Sunshine Date: Mon, 27 Sep 2010 11:02:17 +0000 (-0400) Subject: Add MinGW-specific execv() override. X-Git-Tag: v1.7.4-rc0~193^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5debf9a5ac89e9ba49dedc960078cf22bba25c50;p=git.git Add MinGW-specific execv() override. As of 2dbc887e, shell.c employs execv(), so provide a MinGW-specific mingw_execv() override, complementing existing mingw_execvp() and cousins. As a bonus, this also resolves a compilation warning due to an execv() prototype mismatch between Linux and MinGW. Linux expects the second argument to be (char *const *), whereas MinGW expects (const char *const *). Acked-by: Johannes Schindelin Acked-by: Johannes Sixt Signed-off-by: Eric Sunshine Signed-off-by: Pat Thoyts --- diff --git a/compat/mingw.c b/compat/mingw.c index bd1403a1d..6590f33cc 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -904,6 +904,11 @@ void mingw_execvp(const char *cmd, char *const *argv) free_path_split(path); } +void mingw_execv(const char *cmd, char *const *argv) +{ + mingw_execve(cmd, argv, environ); +} + static char **copy_environ(void) { char **env; diff --git a/compat/mingw.h b/compat/mingw.h index a2213b391..83e35e833 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -256,6 +256,8 @@ pid_t mingw_spawnvpe(const char *cmd, const char **argv, char **env, int fhin, int fhout, int fherr); void mingw_execvp(const char *cmd, char *const *argv); #define execvp mingw_execvp +void mingw_execv(const char *cmd, char *const *argv); +#define execv mingw_execv static inline unsigned int git_ntohl(unsigned int x) { return (unsigned int)ntohl(x); }