EVENT-Backtrace enableable on its own by now.
[citadel.git] / citadel / event_client.c
index 15b5f44a7270b4d903a90f0bc88e944e4b356864..697fd7bcd87a0e171e54fd24090a11b82e2a9a5d 100644 (file)
@@ -976,6 +976,7 @@ int InitcURLIOStruct(AsyncIO *IO,
 
 }
 
+extern int DebugEventLoopBacktrace;
 void EV_backtrace(AsyncIO *IO)
 {
 #ifdef HAVE_BACKTRACE
@@ -983,7 +984,8 @@ void EV_backtrace(AsyncIO *IO)
        size_t size, i;
        char **strings;
 
-
+       if ((IO == NULL) || (DebugEventLoopBacktrace == 0))
+               return;
        size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
        strings = backtrace_symbols(stack_frames, size);
        for (i = 0; i < size; i++) {