]> git.meshlink.io Git - meshlink/commitdiff
Always use the default signal handler for ABRT signals.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 8 May 2011 10:40:44 +0000 (12:40 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 8 May 2011 10:40:44 +0000 (12:40 +0200)
This will allow coredumps to be generated when tinc is daemonized.
Also add the -kABRT option.

src/netutl.c
src/process.c
src/tincd.c

index 6acdffae7975a5864d623fbe2cf6c5864ebf4ce3..56fb65fa896807462be09bc2cfbf098a7e6e1830 100644 (file)
@@ -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();
        }
 }
 
index 0007943ab6332899490ce3732fca5bb483729a77..a3de06591c86b40ccf28b7c3bb1102adee70c258 100644 (file)
@@ -546,6 +546,7 @@ static struct {
        {SIGCHLD, ignore_signal_handler},
        {SIGALRM, sigalrm_handler},
        {SIGWINCH, sigwinch_handler},
+       {SIGABRT, SIG_DFL},
        {0, NULL}
 };
 #endif
index 775815118b6486cc5ec70f56ad4c065c81f49f62..9aec32071cff705061e263b686798e9211f77811 100644 (file)
@@ -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);