mirror of
https://github.com/git/git.git
synced 2026-02-08 00:41:37 +00:00
Let mingw_execve() return an int
This is in the great tradition of POSIX. Original fix by Olivier Refalo. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
committed by
Stepan Kasal
parent
15106ae157
commit
deff26aca2
@@ -1131,7 +1131,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)) {
|
||||
@@ -1139,11 +1139,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)
|
||||
|
||||
Reference in New Issue
Block a user