From 257cb6ac60bb0924720de9e252cdf7f4759bf741 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 8 May 2011 12:40:44 +0200 Subject: [PATCH] Always use the default signal handler for ABRT signals. This will allow coredumps to be generated when tinc is daemonized. Also add the -kABRT option. --- src/netutl.c | 9 +++------ src/process.c | 1 + src/tincd.c | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/netutl.c b/src/netutl.c index 6acdffae..56fb65fa 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -93,8 +93,7 @@ void sockaddr2str(const sockaddr_t *sa, char **addrstr, char **portstr) { if(err) { logger(LOG_ERR, "Error while translating addresses: %s", gai_strerror(err)); - raise(SIGFPE); - exit(0); + abort(); } scopeid = strchr(address, '%'); @@ -155,8 +154,7 @@ int sockaddrcmp_noport(const sockaddr_t *a, const sockaddr_t *b) { default: logger(LOG_ERR, "sockaddrcmp() was called with unknown address family %d, exitting!", a->sa.sa_family); - raise(SIGFPE); - exit(0); + abort(); } } @@ -199,8 +197,7 @@ int sockaddrcmp(const sockaddr_t *a, const sockaddr_t *b) { default: logger(LOG_ERR, "sockaddrcmp() was called with unknown address family %d, exitting!", a->sa.sa_family); - raise(SIGFPE); - exit(0); + abort(); } } diff --git a/src/process.c b/src/process.c index 0007943a..a3de0659 100644 --- a/src/process.c +++ b/src/process.c @@ -546,6 +546,7 @@ static struct { {SIGCHLD, ignore_signal_handler}, {SIGALRM, sigalrm_handler}, {SIGWINCH, sigwinch_handler}, + {SIGABRT, SIG_DFL}, {0, NULL} }; #endif diff --git a/src/tincd.c b/src/tincd.c index 77581511..9aec3207 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -203,6 +203,8 @@ static bool parse_options(int argc, char **argv) { kill_tincd = SIGINT; else if(!strcasecmp(optarg, "ALRM")) kill_tincd = SIGALRM; + else if(!strcasecmp(optarg, "ABRT")) + kill_tincd = SIGABRT; else { kill_tincd = atoi(optarg); -- 2.39.5