Skip to content

Commit

Permalink
msvc: do not pretend to support all signals
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
jeffhostetler authored and gitster committed Jun 25, 2019
1 parent b7bd9a7 commit 446df60
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
}

Expand Down

0 comments on commit 446df60

Please sign in to comment.