diff options
author | Corey Farrell <git@cfware.com> | 2016-09-16 19:54:07 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2016-09-30 19:25:40 -0400 |
commit | 2a03575c30b96ab23e75822c3b256fa0cb591aaa (patch) | |
tree | de4f50f0fe625ed866efd337b5f60f8c711a1f52 /main/utils.c | |
parent | 224c2952922d769af2d0e77da5612b8b7a649b42 (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.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/main/utils.c b/main/utils.c index c8ede91d9..fc7aa30d7 100644 --- a/main/utils.c +++ b/main/utils.c @@ -2467,17 +2467,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(); @@ -2490,7 +2489,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) { |