mirror of
https://github.com/git/git.git
synced 2026-03-19 13:10:05 +01:00
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 <johannes.schindelin@gmx.de>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
This commit is contained in:
committed by
Pat Thoyts
parent
92d45630cc
commit
6ddc4d9fb2
@@ -1106,6 +1106,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;
|
||||
|
||||
@@ -251,6 +251,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); }
|
||||
|
||||
Reference in New Issue
Block a user