Commit 20470f5b authored by Geoff Simmons's avatar Geoff Simmons

restore handler.c -- no compatibility mode, and hence no stack traces,

if execinfo.h is not present
parent dafd20fd
......@@ -22,9 +22,8 @@ varnishevent_SOURCES = \
monitor.c \
strfTIM.h \
strfTIM.c \
format.c
# handler.c
format.c \
handler.c
varnishevent_LDADD = \
${PTHREAD_LIBS} ${RT_LIBS} ${LIBM} @VARNISH_LIBS@ \
......
......@@ -42,10 +42,9 @@
#include <syslog.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#ifndef HAVE_EXECINFO_H
#include "compat/execinfo.h"
#else
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
......@@ -67,6 +66,8 @@
* +1 to phk's rant in varnishd.c about the lack of a standard for this.
*/
#ifdef HAVE_EXECINFO_H
struct symbols {
uintptr_t a;
char *n;
......@@ -165,19 +166,27 @@ stacktrace(void)
}
}
#endif
void
HNDL_Init(const char *a0)
{
#ifdef HAVE_EXECINFO_H
symbol_hack(a0);
#else
(void) a0;
#endif
}
void
HNDL_Abort(int sig)
{
AZ(sigaction(SIGABRT, &default_action, NULL));
LOG_Log(LOG_ALERT, "Received signal %d (%s), stacktrace follows", sig,
strsignal(sig));
LOG_Log(LOG_ALERT, "Received signal %d (%s)", sig, strsignal(sig));
#ifdef HAVE_EXECINFO_H
LOG_Log0(LOG_NOTICE, "Stacktrace follows");
stacktrace();
#endif
CONF_Dump();
DATA_Dump();
MON_Output();
......
......@@ -562,16 +562,12 @@ main(int argc, char *argv[])
AZ(sigemptyset(&reopen_action.sa_mask));
reopen_action.sa_flags |= SA_RESTART;
#if 0
stacktrace_action.sa_handler = HNDL_Abort;
#endif
ignore_action.sa_handler = SIG_IGN;
default_action.sa_handler = SIG_DFL;
#if 0
HNDL_Init(argv[0]);
#endif
/* Install signal handlers */
#include "signals.h"
......
......@@ -296,10 +296,8 @@ int FMT_Estimate_RecsPerTx(void);
void FMT_Format(tx_t *tx, struct vsb *os);
void FMT_Fini(void);
#if 0
/* handler.c */
void HNDL_Init(const char *a0);
void HNDL_Abort(int sig);
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment