mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-10-26 14:02:00 +01:00
41 lines
817 B
Diff
41 lines
817 B
Diff
diff --git a/src/sighand.c b/src/sighand.c
|
|
index 1ebf206..985e470 100644
|
|
--- a/src/sighand.c
|
|
+++ b/src/sighand.c
|
|
@@ -30,7 +30,10 @@
|
|
#include <errno.h> /* for errno() */
|
|
#include <sys/wait.h> /* for wait() */
|
|
#include <sys/socket.h> /* for shutdown() */
|
|
+
|
|
+#ifdef HAVE_EXECINFO_H
|
|
#include <execinfo.h>
|
|
+#endif
|
|
|
|
#include "log.h"
|
|
#include "sighand.h"
|
|
@@ -112,6 +115,7 @@ sighand_chld (pid_t pid)
|
|
waitpid (pid, &status, WNOHANG);
|
|
}
|
|
|
|
+#ifdef HAVE_EXECINFO_H
|
|
static void
|
|
print_trace ()
|
|
{
|
|
@@ -126,13 +130,16 @@ print_trace ()
|
|
log_write ("%s\n", symbols[i]);
|
|
g_free (symbols);
|
|
}
|
|
+#endif
|
|
|
|
void
|
|
sighand_segv ()
|
|
{
|
|
signal (SIGSEGV, _exit);
|
|
log_write ("SIGSEGV occured !");
|
|
+ #ifdef HAVE_EXECINFO_H
|
|
print_trace ();
|
|
+ #endif
|
|
make_em_die (SIGTERM);
|
|
log_close ();
|
|
_exit (0);
|