X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fcitserver.c;h=06b31b94429e9ba96c41b49b71120570dcb3d2c8;hp=3ac69266d64099991dff643937446517b03d6a15;hb=c750a06a241dc2737fa68c24b340a1bd82894f74;hpb=82adc0fcf4da8e91ec4ff11f1a0f9d96449f85ad diff --git a/citadel/citserver.c b/citadel/citserver.c index 3ac69266d..06b31b944 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -18,9 +18,6 @@ #include #include "sysdep.h" #include -#if HAVE_BACKTRACE -#include -#endif #include #include "ctdl_module.h" @@ -37,84 +34,6 @@ time_t server_startup_time; int panic_fd; int openid_level_supported = 0; -/* - * print the actual stack frame. - */ -void cit_backtrace(void) -{ -#ifdef HAVE_BACKTRACE - void *stack_frames[50]; - size_t size, i; - char **strings; - - const char *p = IOSTR; - if (p == NULL) p = ""; - size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*)); - strings = backtrace_symbols(stack_frames, size); - for (i = 0; i < size; i++) { - if (strings != NULL) { - syslog(LOG_DEBUG, "citserver: %s %s", p, strings[i]); - } - else { - syslog(LOG_DEBUG, "citserver: %s %p", p, stack_frames[i]); - } - } - free(strings); -#endif -} - -void cit_oneline_backtrace(void) -{ -#ifdef HAVE_BACKTRACE - void *stack_frames[50]; - size_t size, i; - char **strings; - StrBuf *Buf; - - size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*)); - strings = backtrace_symbols(stack_frames, size); - if (size > 0) - { - Buf = NewStrBuf(); - for (i = 1; i < size; i++) { - if (strings != NULL) - StrBufAppendPrintf(Buf, "%s : ", strings[i]); - else - StrBufAppendPrintf(Buf, "%p : ", stack_frames[i]); - } - free(strings); - syslog(LOG_DEBUG, "citserver: %s %s", IOSTR, ChrPtr(Buf)); - FreeStrBuf(&Buf); - } -#endif -} - - -/* - * print the actual stack frame. - */ -void cit_panic_backtrace(int SigNum) -{ -#ifdef HAVE_BACKTRACE - void *stack_frames[10]; - size_t size, i; - char **strings; - - printf("caught signal 11\n"); - size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*)); - strings = backtrace_symbols(stack_frames, size); - for (i = 0; i < size; i++) { - if (strings != NULL) { - syslog(LOG_DEBUG, "%s", strings[i]); - } - else { - syslog(LOG_DEBUG, "%p", stack_frames[i]); - } - } - free(strings); -#endif - exit(-1); -} /* * Various things that need to be initialized at startup