mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Provide git_exit() for MinGW
Apparently, MinGW's exit function has problems with negative exit codes. Substitute them by 1. This fixes at least t1300, which failed because the exit code of git-config with an invalid file was 0. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -322,3 +322,12 @@ int mingw_socket(int domain, int type, int protocol)
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
#undef exit
|
||||
int git_exit(int code)
|
||||
{
|
||||
if (code < 0)
|
||||
exit(1);
|
||||
exit(code);
|
||||
}
|
||||
|
||||
|
||||
@@ -472,6 +472,9 @@ int mingw_socket(int domain, int type, int protocol);
|
||||
extern void quote_argv(const char **dst, const char **src);
|
||||
extern const char *parse_interpreter(const char *cmd);
|
||||
|
||||
extern __attribute__((noreturn)) int git_exit(int code);
|
||||
#define exit git_exit
|
||||
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user