Skip to content

Commit 502bfc7

Browse files
committed
core: only generate backtraces if EXTRA_DEBUG is defined.
This fixes build on systems that have no backtrace API in the libc (e.g. BSDs).
1 parent b2971b1 commit 502bfc7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

io_wait.h

+6
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@
9494
#ifdef __OS_linux
9595
#include <features.h> /* for GLIBC version testing */
9696
#endif
97+
#ifdef EXTRA_DEBUG
9798
#include "lib/dbg/backtrace.h"
99+
#endif
98100

99101
#ifndef FD_TYPE_DEFINED
100102
typedef int fd_type;
@@ -732,13 +734,17 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx,
732734
if (!(idx>=0 && idx<h->fd_no)) {
733735
LM_CRIT("[%s] FD index check failed, idx=%d, max=%d"
734736
" operating on %d\n",h->name, idx, h->fd_no, fd );
737+
#ifdef EXTRA_DEBUG
735738
log_backtrace();
739+
#endif
736740
rla_dump();
737741
idx = -1;
738742
} else if (h->fd_array[idx].fd!=fd) {
739743
LM_CRIT("[%s] FD consistency check failed, idx=%d points to fd=%d,"
740744
" but operating on %d\n",h->name, idx, h->fd_array[idx].fd, fd );
745+
#ifdef EXTRA_DEBUG
741746
log_backtrace();
747+
#endif
742748
rla_dump();
743749
idx = -1;
744750
}

0 commit comments

Comments
 (0)