Commit e44e54dc authored by Nils Goroll's avatar Nils Goroll Committed by Pål Hermunn Johansen

start generalizing the signal handler

it was already used for more than SIGSEGV, so we should output the actual
signal description.

Conflicts:
	bin/varnishd/mgt/mgt_child.c
parent 1ec38efb
......@@ -273,18 +273,19 @@ child_poker(const struct vev *e, int what)
}
/*=====================================================================
* SIGSEGV handler for child process
* signal handler for child process
*/
static void __match_proto__()
child_sigsegv_handler(int s, siginfo_t *si, void *c)
child_signal_handler(int s, siginfo_t *si, void *c)
{
char buf[1024];
(void)s;
(void)c;
sprintf(buf, "Segmentation fault by instruction at %p", si->si_addr);
bprintf(buf, "Signal %d (%s) received at %p si_code %d",
s, strsignal(s), si->si_addr, si->si_code);
VAS_Fail(__func__,
__FILE__,
__LINE__,
......@@ -389,7 +390,7 @@ mgt_launch_child(struct cli *cli)
if (mgt_param.sigsegv_handler) {
memset(&sa, 0, sizeof sa);
sa.sa_sigaction = child_sigsegv_handler;
sa.sa_sigaction = child_signal_handler;
sa.sa_flags = SA_SIGINFO;
(void)sigaction(SIGSEGV, &sa, NULL);
(void)sigaction(SIGBUS, &sa, NULL);
......
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