Skip to content

Commit 570f1e6

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Stepan Kasal <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5182265 commit 570f1e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compat/mingw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,19 +1019,20 @@ static int try_shell_exec(const char *cmd, char *const *argv, char **env)
10191019
return pid;
10201020
}
10211021

1022-
static void mingw_execve(const char *cmd, char *const *argv, char *const *env)
1022+
static int mingw_execve(const char *cmd, char *const *argv, char *const *env)
10231023
{
10241024
/* check if git_command is a shell script */
10251025
if (!try_shell_exec(cmd, argv, (char **)env)) {
10261026
int pid, status;
10271027

10281028
pid = mingw_spawnve(cmd, (const char **)argv, (char **)env, 0);
10291029
if (pid < 0)
1030-
return;
1030+
return -1;
10311031
if (waitpid(pid, &status, 0) < 0)
10321032
status = 255;
10331033
exit(status);
10341034
}
1035+
return -1;
10351036
}
10361037

10371038
int mingw_execvp(const char *cmd, char *const *argv)

0 commit comments

Comments
 (0)