summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2019-06-25 14:49:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-25 17:46:58 (GMT)
commit446df60367be5f3a97f7bac12071878d1fdbebd2 (patch)
tree60d3cf52a86abf1aade0c655c3b39a2b2fb54291 /compat/mingw.c
parentb7bd9a73381df1dcc3c408a8f4379cb6f1db6785 (diff)
downloadgit-446df60367be5f3a97f7bac12071878d1fdbebd2.zip
git-446df60367be5f3a97f7bac12071878d1fdbebd2.tar.gz
git-446df60367be5f3a97f7bac12071878d1fdbebd2.tar.bz2
msvc: do not pretend to support all signals
This special-cases various signals that are not supported on Windows, such as SIGPIPE. These cause the UCRT to throw asserts (at least in debug mode). Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 6672858..d01e88c 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -2119,8 +2119,33 @@ int mingw_raise(int sig)
sigint_fn(SIGINT);
return 0;
+#if defined(_MSC_VER)
+ case SIGILL:
+ case SIGFPE:
+ case SIGSEGV:
+ case SIGTERM:
+ case SIGBREAK:
+ case SIGABRT:
+ case SIGABRT_COMPAT:
+ /*
+ * The <signal.h> header in the MS C Runtime defines 8 signals
+ * as being supported on the platform. Anything else causes an
+ * "Invalid signal or error" (which in DEBUG builds causes the
+ * Abort/Retry/Ignore dialog). We by-pass the CRT for things we
+ * already know will fail.
+ */
+ return raise(sig);
+ default:
+ errno = EINVAL;
+ return -1;
+
+#else
+
default:
return raise(sig);
+
+#endif
+
}
}