Index: compiler-rt/lib/sanitizer_common/sanitizer_signal_interceptors.inc =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_signal_interceptors.inc +++ compiler-rt/lib/sanitizer_common/sanitizer_signal_interceptors.inc @@ -18,10 +18,22 @@ using namespace __sanitizer; +#ifndef SIGNAL_INTERCEPTOR_SIGNAL_IMPL +#define SIGNAL_INTERCEPTOR_SIGNAL_IMPL(func, signum, handler) { \ + return REAL(func)(signum, handler); \ +} +#endif + +#ifndef SIGNAL_INTERCEPTOR_SIGACTION_IMPL +#define SIGNAL_INTERCEPTOR_SIGACTION_IMPL(signum, act, oldact) { \ + return REAL(sigaction)(signum, act, oldact); \ +} +#endif + #if SANITIZER_INTERCEPT_BSD_SIGNAL INTERCEPTOR(void *, bsd_signal, int signum, void *handler) { if (GetHandleSignalMode(signum) == kHandleSignalExclusive) return 0; - return REAL(bsd_signal)(signum, handler); + SIGNAL_INTERCEPTOR_SIGNAL_IMPL(bsd_signal, signum, handler); } #define INIT_BSD_SIGNAL COMMON_INTERCEPT_FUNCTION(bsd_signal) #else // SANITIZER_INTERCEPT_BSD_SIGNAL @@ -31,14 +43,14 @@ #if SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION INTERCEPTOR(void *, signal, int signum, void *handler) { if (GetHandleSignalMode(signum) == kHandleSignalExclusive) return nullptr; - return REAL(signal)(signum, handler); + SIGNAL_INTERCEPTOR_SIGNAL_IMPL(signal, signum, handler); } #define INIT_SIGNAL COMMON_INTERCEPT_FUNCTION(signal) INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) { if (GetHandleSignalMode(signum) == kHandleSignalExclusive) return 0; - return REAL(sigaction)(signum, act, oldact); + SIGNAL_INTERCEPTOR_SIGACTION_IMPL(signum, act, oldact); } #define INIT_SIGACTION COMMON_INTERCEPT_FUNCTION(sigaction)