mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
don't export our private functions. fix crash protection build.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4803 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -638,56 +638,6 @@ SWITCH_DECLARE(unsigned int) switch_core_session_running(switch_core_session_t *
|
||||
return session->thread_running;
|
||||
}
|
||||
|
||||
#ifdef CRASH_PROT
|
||||
#if defined (__GNUC__) && defined (LINUX)
|
||||
#include <execinfo.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define STACK_LEN 10
|
||||
|
||||
/* Obtain a backtrace and print it to stdout. */
|
||||
static void print_trace(void)
|
||||
{
|
||||
void *array[STACK_LEN];
|
||||
size_t size;
|
||||
char **strings;
|
||||
size_t i;
|
||||
|
||||
size = backtrace(array, STACK_LEN);
|
||||
strings = backtrace_symbols(array, size);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Obtained %zd stack frames.\n", size);
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CRIT, "%s\n", strings[i]);
|
||||
}
|
||||
|
||||
free(strings);
|
||||
}
|
||||
#else
|
||||
static void print_trace(void)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Trace not avaliable =(\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void handle_fatality(int sig)
|
||||
{
|
||||
switch_thread_id_t thread_id;
|
||||
jmp_buf *env;
|
||||
|
||||
if (sig && (thread_id = switch_thread_self())
|
||||
&& (env = (jmp_buf *) apr_hash_get(runtime.stack_table, &thread_id, sizeof(thread_id)))) {
|
||||
print_trace();
|
||||
longjmp(*env, sig);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Caught signal %d for unmapped thread!", sig);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session_t **session)
|
||||
{
|
||||
@@ -900,7 +850,7 @@ SWITCH_DECLARE(uint32_t) switch_core_session_limit(uint32_t new_limit)
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_session_init(switch_memory_pool_t *pool)
|
||||
void switch_core_session_init(switch_memory_pool_t *pool)
|
||||
{
|
||||
memset(&runtime, 0, sizeof(runtime));
|
||||
runtime.session_limit = 1000;
|
||||
|
||||
Reference in New Issue
Block a user