]> code.citadel.org Git - citadel.git/blobdiff - citadel/ecrash.c
Remove all uses of __FUNCTION__ because it is not portable
[citadel.git] / citadel / ecrash.c
index f93742a71fd137006f6b76aa99bca0ea50b2e5a5..1c0514a02395b047b6a9fd3120a45649b18a713f 100644 (file)
@@ -45,7 +45,7 @@
 #include "citserver.h"
 #include "ecrash.h"
 
-#define NIY()  printf("%s: Not Implemented Yet!\n", __FUNCTION__)
+#define NIY()  printf("function not implemented yet!\n");
 #ifdef HAVE_BACKTRACE
 #include <execinfo.h>
 static eCrashParameters gbl_params;
@@ -58,7 +58,6 @@ static int    gbl_backtraceDoneFlag = 0;
 static void *stack_frames[50];
 static size_t size, NThread;
 static char **strings;
-static char StaticBuf[SIZ];
 
 /* 
  * Private structures for our thread list
@@ -185,14 +184,7 @@ static void outputPrintf(char *format, ...)
 
        va_start(ap, format);
 
-       if (enable_syslog)
-       {
-               snprintf (StaticBuf, SIZ, format, ap);
-               syslog( LOG_CRIT|LOG_NDELAY|LOG_MAIL, StaticBuf);
-       }
-       else
-               CtdlLogPrintf(CTDL_EMERG, format, ap);
-
+       vsyslog(LOG_CRIT|LOG_NDELAY|LOG_MAIL, format, ap);
 } // outputPrintf
 
 
@@ -208,25 +200,14 @@ static void createGlobalBacktrace( void )
 {
 
        size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
-       if (enable_syslog)
-               for (NThread = 0; NThread < size; NThread++) 
-               {
-                       snprintf (StaticBuf, SIZ, "RAW: %p  ", stack_frames[NThread]);
-                       syslog( LOG_CRIT|LOG_NDELAY|LOG_MAIL, StaticBuf);
-               }
-       else 
-               for (NThread = 0; NThread < size; NThread++) 
-                       CtdlLogPrintf(1, "RAW: %p\n", stack_frames[NThread]);
+       for (NThread = 0; NThread < size; NThread++) 
+       {
+               syslog(LOG_CRIT|LOG_NDELAY|LOG_MAIL, "RAW: %p  ", stack_frames[NThread]);
+       }
        strings = backtrace_symbols(stack_frames, size);
        for (NThread = 0; NThread < size; NThread++) {
                if (strings != NULL) {
-                       if (enable_syslog)
-                       {// vsyslogs printf compliance sucks.
-                               snprintf (StaticBuf, SIZ, "RAW: %p  ", strings[NThread]);
-                               syslog( LOG_CRIT|LOG_NDELAY|LOG_MAIL, StaticBuf);
-                       }
-                       else
-                               CtdlLogPrintf(1, "%s\n", strings[NThread]);
+                       syslog(LOG_CRIT|LOG_NDELAY|LOG_MAIL, "RAW: %p  ", strings[NThread]);
                }
        }
 } /* createGlobalBacktrace */
@@ -234,15 +215,10 @@ static void outputRawtrace( void )
 {
 
        size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
-       if (enable_syslog)
-               for (NThread = 0; NThread < size; NThread++) 
-               {
-                       snprintf (StaticBuf, SIZ, "RAW: %p  ", stack_frames[NThread]);
-                       syslog( LOG_CRIT|LOG_NDELAY|LOG_MAIL, StaticBuf);
-               }
-       else 
-               for (NThread = 0; NThread < size; NThread++) 
-                       CtdlLogPrintf(1, "RAW: %p\n", stack_frames[NThread]);
+       for (NThread = 0; NThread < size; NThread++) 
+       {
+               syslog(LOG_CRIT|LOG_NDELAY|LOG_MAIL, "RAW: %p  ", stack_frames[NThread]);
+       }
 } /* createGlobalBacktrace */
 
 /*!