};
static struct str_table generic_code_table[] = {
+#ifdef SI_ASYNCNL
DEFINE_ENTRY(SI_ASYNCNL)
+#endif
+#ifdef SI_TKILL
DEFINE_ENTRY(SI_TKILL)
+#endif
+#ifdef SI_SIGIO
DEFINE_ENTRY(SI_SIGIO)
+#endif
+#ifdef SI_ASYNCIO
DEFINE_ENTRY(SI_ASYNCIO)
+#endif
+#ifdef SI_MESGQ
DEFINE_ENTRY(SI_MESGQ)
+#endif
+#ifdef SI_TIMER
DEFINE_ENTRY(SI_TIMER)
+#endif
+#ifdef SI_QUEUE
DEFINE_ENTRY(SI_QUEUE)
+#endif
+#ifdef SI_USER
DEFINE_ENTRY(SI_USER)
+#endif
+#ifdef SI_KERNEL
DEFINE_ENTRY(SI_KERNEL)
+#endif
END_TABLE
};
END_TABLE
};
+#if 0 /* should this be hooked in somewhere? */
static struct str_table sigstrap_code_table[] = {
#ifdef TRAP_BRKPT
DEFINE_ENTRY(TRAP_BRKPT)
#endif
END_TABLE
};
+#endif
static struct str_table sigcld_code_table[] = {
#ifdef CLD_EXITED
END_TABLE
};
+#if 0 /* should this be hooked in somewhere? */
static struct str_table sigpoll_code_table[] = {
#ifdef POLL_IN
DEFINE_ENTRY(POLL_IN)
#endif
END_TABLE
};
+#endif
static const char *lookup_table(int num, struct str_table *table)
{
return buf;
}
-static void die_signal_handler(int signum, siginfo_t *siginfo, void *context)
+static void die_signal_handler(int signum, siginfo_t *siginfo,
+ void *context EXT2FS_ATTR((unused)))
{
- void *stack_syms[32];
- int frames;
const char *cp;
fprintf(stderr, "Signal (%d) %s ", signum,
fprintf(stderr, "si_code=%s ",
lookup_table_fallback(siginfo->si_code,
sigbus_code_table));
- else if (signum == SIGCLD)
+ else if (signum == SIGCHLD)
fprintf(stderr, "si_code=%s ",
lookup_table_fallback(siginfo->si_code,
sigcld_code_table));
fprintf(stderr, "fault addr=%p", siginfo->si_addr);
fprintf(stderr, "\n");
-#ifdef HAVE_BACKTRACE
- frames = backtrace(stack_syms, 32);
- backtrace_symbols_fd(stack_syms, frames, 2);
+#if defined(HAVE_BACKTRACE) && !defined(DISABLE_BACKTRACE)
+ {
+ void *stack_syms[32];
+ int frames;
+
+ frames = backtrace(stack_syms, 32);
+ backtrace_symbols_fd(stack_syms, frames, 2);
+ }
#endif
exit(FSCK_ERROR);
}
sigaction(SIGILL, &sa, 0);
sigaction(SIGBUS, &sa, 0);
sigaction(SIGSEGV, &sa, 0);
+ sigaction(SIGABRT, &sa, 0);
}