summaryrefslogtreecommitdiff
path: root/main/utils.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2016-10-07 18:32:16 -0400
committerCorey Farrell <git@cfware.com>2016-10-07 18:32:16 -0400
commitdd873bcada4e257ba8e8b497b1a36036b09f5635 (patch)
tree363eb368b634bd78ce525a4d1f76c5448b9ef797 /main/utils.c
parentf166681c121265b92a9091bdafab9980c086b9d2 (diff)
astobj2: Add backtrace to log_bad_ao2.
* Compile __ast_assert_failed unconditionally. * Use __ast_assert_failed to log messages from log_bad_ao2 * Remove calls to ast_assert(0) that happen after log_bad_ao2 was run. Change-Id: I48f1af44b2718ad74a421ff75cb6397b924a9751
Diffstat (limited to 'main/utils.c')
-rw-r--r--main/utils.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/main/utils.c b/main/utils.c
index 1a034c101..af0ee7f6b 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -2437,17 +2437,16 @@ void DO_CRASH_NORETURN ast_do_crash(void)
#endif /* defined(DO_CRASH) */
}
-#if defined(AST_DEVMODE)
void DO_CRASH_NORETURN __ast_assert_failed(int condition, const char *condition_str, const char *file, int line, const char *function)
{
/*
* Attempt to put it into the logger, but hope that at least
* someone saw the message on stderr ...
*/
- ast_log(__LOG_ERROR, file, line, function, "FRACK!, Failed assertion %s (%d)\n",
- condition_str, condition);
fprintf(stderr, "FRACK!, Failed assertion %s (%d) at line %d in %s of %s\n",
condition_str, condition, line, function, file);
+ ast_log(__LOG_ERROR, file, line, function, "FRACK!, Failed assertion %s (%d)\n",
+ condition_str, condition);
/* Generate a backtrace for the assert */
ast_log_backtrace();
@@ -2460,7 +2459,6 @@ void DO_CRASH_NORETURN __ast_assert_failed(int condition, const char *condition_
usleep(1);
ast_do_crash();
}
-#endif /* defined(AST_DEVMODE) */
char *ast_eid_to_str(char *s, int maxlen, struct ast_eid *eid)
{