diff options
Diffstat (limited to 'lib/sigevent.c')
| -rw-r--r-- | lib/sigevent.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/sigevent.c b/lib/sigevent.c index f00ff4921e..d02b074223 100644 --- a/lib/sigevent.c +++ b/lib/sigevent.c @@ -209,12 +209,14 @@ exit_handler(int signo #endif ) { - zlog_signal(signo, "exiting..." -#ifdef SA_SIGINFO - , - siginfo, program_counter(context) +#ifndef SA_SIGINFO + void *siginfo = NULL; + void *pc = NULL; +#else + void *pc = program_counter(context); #endif - ); + + zlog_signal(signo, "exiting...", siginfo, pc); _exit(128 + signo); } @@ -226,6 +228,13 @@ core_handler(int signo #endif ) { +#ifndef SA_SIGINFO + void *siginfo = NULL; + void *pc = NULL; +#else + void *pc = program_counter(context); +#endif + /* make sure we don't hang in here. default for SIGALRM is terminate. * - if we're in backtrace for more than a second, abort. */ struct sigaction sa_default = {.sa_handler = SIG_DFL}; @@ -238,12 +247,8 @@ core_handler(int signo alarm(1); - zlog_signal(signo, "aborting..." -#ifdef SA_SIGINFO - , - siginfo, program_counter(context) -#endif - ); + zlog_signal(signo, "aborting...", siginfo, pc); + /* dump memory stats on core */ log_memstats(stderr, "core_handler"); abort(); |
