Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 510e5db

Browse files
dschokasal
authored andcommitted
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]>
1 parent 2ab31b6 commit 510e5db

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
@@ -1131,19 +1131,20 @@ static int try_shell_exec(const char *cmd, char *const *argv, char **env)
11311131
return pid;
11321132
}
11331133

1134-
static void mingw_execve(const char *cmd, char *const *argv, char *const *env)
1134+
static int mingw_execve(const char *cmd, char *const *argv, char *const *env)
11351135
{
11361136
/* check if git_command is a shell script */
11371137
if (!try_shell_exec(cmd, argv, (char **)env)) {
11381138
int pid, status;
11391139

11401140
pid = mingw_spawnve(cmd, (const char **)argv, (char **)env, 0);
11411141
if (pid < 0)
1142-
return;
1142+
return -1;
11431143
if (waitpid(pid, &status, 0) < 0)
11441144
status = 255;
11451145
exit(status);
11461146
}
1147+
return -1;
11471148
}
11481149

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

0 commit comments

Comments
 (0)