os/osinit.c, os/utils.c: Exclude sigaction code when building for MinGW
MinGW doesn't have sigaction, so this patch is needed for building. No attempt is made to actually install the fatal error signal handler, as MinGW will simply terminate the process rather than deliver a fatal signal. Also avoid using strsignal Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
@@ -212,6 +212,9 @@ sig_atomic_t inSignalContext = FALSE;
|
||||
OsSigHandlerPtr
|
||||
OsSignal(int sig, OsSigHandlerPtr handler)
|
||||
{
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
return signal(sig, handler);
|
||||
#else
|
||||
struct sigaction act, oact;
|
||||
|
||||
sigemptyset(&act.sa_mask);
|
||||
@@ -222,6 +225,7 @@ OsSignal(int sig, OsSigHandlerPtr handler)
|
||||
if (sigaction(sig, &act, &oact))
|
||||
perror("sigaction");
|
||||
return oact.sa_handler;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user