summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77df1f1)
raw | patch | inline | side by side (parent: 77df1f1)
author | Eric Sunshine <sunshine@sunshineco.com> | |
Mon, 27 Sep 2010 11:02:17 +0000 (07:02 -0400) | ||
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Sun, 3 Oct 2010 22:34:25 +0000 (23:34 +0100) |
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 <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
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 <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
compat/mingw.c | patch | blob | history | |
compat/mingw.h | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index bd1403a1d510aa35f9e5e32f762ac519e1b6b176..6590f33cc8157f61ff7b6e0f6330bacf465ad39c 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
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 a2213b39118f6ee24f94446891c6b43035744c68..83e35e833b7f214e5d10a3e74a75fb17d80c2e13 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
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); }