mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
use a symbolic constant instead of a magic number (tholo!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
7
logger.c
7
logger.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Asterisk -- An open source telephony toolkit.
|
* Asterisk -- An open source telephony toolkit.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 - 2005, Digium, Inc.
|
* Copyright (C) 1999 - 2006, Digium, Inc.
|
||||||
*
|
*
|
||||||
* Mark Spencer <markster@digium.com>
|
* Mark Spencer <markster@digium.com>
|
||||||
*
|
*
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef STACK_BACKTRACES
|
#ifdef STACK_BACKTRACES
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
|
#define MAX_BACKTRACE_FRAMES 20
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SYSLOG_NAMES /* so we can map syslog facilities names to their numeric values,
|
#define SYSLOG_NAMES /* so we can map syslog facilities names to their numeric values,
|
||||||
@@ -836,9 +837,9 @@ void ast_backtrace(void)
|
|||||||
void **addresses;
|
void **addresses;
|
||||||
char **strings;
|
char **strings;
|
||||||
|
|
||||||
addresses = calloc(20, sizeof(void *));
|
addresses = calloc(MAX_BACKTRACE_FRAMES, sizeof(void *));
|
||||||
if (addresses) {
|
if (addresses) {
|
||||||
count = backtrace(addresses, 20);
|
count = backtrace(addresses, MAX_BACKTRACE_FRAMES);
|
||||||
strings = backtrace_symbols(addresses, count);
|
strings = backtrace_symbols(addresses, count);
|
||||||
if (strings) {
|
if (strings) {
|
||||||
ast_log(LOG_DEBUG, "Got %d backtrace record%c\n", count, count != 1 ? 's' : ' ');
|
ast_log(LOG_DEBUG, "Got %d backtrace record%c\n", count, count != 1 ? 's' : ' ');
|
||||||
|
Reference in New Issue
Block a user