From: Johannes Schindelin Date: Tue, 29 May 2012 02:21:39 +0000 (-0500) Subject: Win32: let mingw_execve() return an int X-Git-Tag: v2.1.0-rc0~58^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=570f1e6e1a7145efb4e80da9c711fcbc319f6b17;p=thirdparty%2Fgit.git Win32: let mingw_execve() return an int This is in the great tradition of POSIX. Original fix by Olivier Refalo. Signed-off-by: Johannes Schindelin Signed-off-by: Stepan Kasal Signed-off-by: Junio C Hamano --- diff --git a/compat/mingw.c b/compat/mingw.c index d242557eb5..7da73fa617 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1019,7 +1019,7 @@ static int try_shell_exec(const char *cmd, char *const *argv, char **env) return pid; } -static void mingw_execve(const char *cmd, char *const *argv, char *const *env) +static int mingw_execve(const char *cmd, char *const *argv, char *const *env) { /* check if git_command is a shell script */ if (!try_shell_exec(cmd, argv, (char **)env)) { @@ -1027,11 +1027,12 @@ static void mingw_execve(const char *cmd, char *const *argv, char *const *env) pid = mingw_spawnve(cmd, (const char **)argv, (char **)env, 0); if (pid < 0) - return; + return -1; if (waitpid(pid, &status, 0) < 0) status = 255; exit(status); } + return -1; } int mingw_execvp(const char *cmd, char *const *argv)