]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blobdiff - e2fsck/sigcatcher.c
Merge branch 'maint' into next
[thirdparty/e2fsprogs.git] / e2fsck / sigcatcher.c
index bd56c3f27832d263bf591bca32c3d3e81c00140f..a9d3b7f2ce79e2d890a9a0dc27e3c063cff8c5d9 100644 (file)
@@ -251,6 +251,7 @@ static struct str_table sigbus_code_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)
@@ -260,6 +261,7 @@ static struct str_table sigstrap_code_table[] = {
 #endif
        END_TABLE
 };
+#endif
 
 static struct str_table sigcld_code_table[] = {
 #ifdef CLD_EXITED
@@ -283,6 +285,7 @@ static struct str_table sigcld_code_table[] = {
        END_TABLE
 };
 
+#if 0 /* should this be hooked in somewhere? */
 static struct str_table sigpoll_code_table[] = {
 #ifdef POLL_IN
        DEFINE_ENTRY(POLL_IN)
@@ -304,6 +307,7 @@ static struct str_table sigpoll_code_table[] = {
 #endif
        END_TABLE
 };
+#endif
 
 static const char *lookup_table(int num, struct str_table *table)
 {
@@ -327,10 +331,9 @@ static const char *lookup_table_fallback(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,
@@ -368,9 +371,14 @@ static void die_signal_handler(int signum, siginfo_t *siginfo, void *context)
               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);
 }