summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 606475f)
raw | patch | inline | side by side (parent: 606475f)
author | Johannes Sixt <j6t@kdbg.org> | |
Sun, 5 Jul 2009 18:57:46 +0000 (20:57 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 5 Jul 2009 19:16:26 +0000 (12:16 -0700) |
For some reason, MinGW's bash cannot reliably detect failure of the child
process if a negative value is passed to exit(). This fixes it by
truncating the exit code in all calls of exit().
This issue was worked around in run_builtin() of git.c (2488df84 builtin
run_command: do not exit with -1, 2007-11-15). This workaround is no longer
necessary and is reverted.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
process if a negative value is passed to exit(). This fixes it by
truncating the exit code in all calls of exit().
This issue was worked around in run_builtin() of git.c (2488df84 builtin
run_command: do not exit with -1, 2007-11-15). This workaround is no longer
necessary and is reverted.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.h | patch | blob | history | |
git.c | patch | blob | history |
diff --git a/compat/mingw.h b/compat/mingw.h
index 4f7ba4c13f9d0086acf9d1cfadf6912b1d641033..c1859c5480f67dbe9640975d68407f2c1efd15f5 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
errno = EINVAL;
return -1;
}
+/* bash cannot reliably detect negative return codes as failure */
+#define exit(code) exit((code) & 0xff)
/*
* simple adaptors