]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/util/fault.c
Merge master
[netatalk.git] / libatalk / util / fault.c
index c9bce38c39272a66091a6d23ca0bb0093ce4cba8..48c4fe058d715c094d9e5a9035866eade4d2bf1d 100644 (file)
@@ -36,7 +36,7 @@
 #include <atalk/logger.h>
 
 #ifndef SIGNAL_CAST
-#define SIGNAL_CAST (RETSIGTYPE (*)(int))
+#define SIGNAL_CAST (void (*)(int))
 #endif
 #ifndef SAFE_FREE /* Oh no this is also defined in tdb.h */
 #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
@@ -93,6 +93,7 @@ void netatalk_panic(const char *why)
        backtrace_size = backtrace(backtrace_stack,BACKTRACE_STACK_SIZE);
        backtrace_strings = backtrace_symbols(backtrace_stack, backtrace_size);
 
+       LOG(log_severe, logtype_default, "PANIC: %s", why);
        LOG(log_severe, logtype_default, "BACKTRACE: %d stack frames:", backtrace_size);
        
        if (backtrace_strings) {
@@ -114,7 +115,8 @@ static void fault_report(int sig)
 {
        static int counter;
 
-       if (counter) _exit(1);
+       if (counter)
+        abort();
 
        counter++;
 
@@ -134,7 +136,7 @@ static void fault_report(int sig)
 #endif
                return; /* this should cause a core dump */
        }
-       exit(1);
+    abort();
 }
 
 /****************************************************************************