POSIX style 2/2

This commit is contained in:
Olivier Refalo
2012-05-09 13:50:07 -03:00
committed by Johannes Schindelin
parent 36a84d5704
commit 7cbd3240e4

View File

@@ -1233,7 +1233,7 @@ static int try_shell_exec(const char *cmd, char *const *argv)
return pid;
}
void mingw_execv(const char *cmd, char *const *argv)
int mingw_execv(const char *cmd, char *const *argv)
{
/* check if git_command is a shell script */
if (!try_shell_exec(cmd, argv)) {
@@ -1241,11 +1241,12 @@ void mingw_execv(const char *cmd, char *const *argv)
pid = mingw_spawnv(cmd, (const char **)argv, 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)