]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
Revert xmpp back to a working state
[citadel.git] / citadel / citserver.c
index e5029fe51566f46a132fa598641f8a9ce6c3985f..18e0112487d70c1d98458a30c6536364714681a7 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Main source module for the Citadel server
  *
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2014 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
 
 #include <stdio.h>
 #include "sysdep.h"
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
+#include <time.h>
 #if HAVE_BACKTRACE
 #include <execinfo.h>
 #endif
@@ -54,14 +44,15 @@ void cit_backtrace(void)
        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_ALERT, "%s\n", strings[i]);
+                       syslog(LOG_ALERT, "%s %s\n", p, strings[i]);
                else
-                       syslog(LOG_ALERT, "%p\n", stack_frames[i]);
+                       syslog(LOG_ALERT, "%s %p\n", p, stack_frames[i]);
        }
        free(strings);
 #endif
@@ -87,7 +78,7 @@ void cit_oneline_backtrace(void)
                                StrBufAppendPrintf(Buf, "%p : ", stack_frames[i]);
                }
                free(strings);
-               syslog(LOG_ALERT, "%s\n", ChrPtr(Buf));
+               syslog(LOG_ALERT, "%s %s\n", IOSTR, ChrPtr(Buf));
                FreeStrBuf(&Buf);
        }
 #endif