From 64bbce9b9b8fc47e773d979372620ce05a01ba05 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Fri, 18 Jul 2008 16:30:31 +0000 Subject: [PATCH] Make the ast_assert call within ast_sched_del report something useful. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131970 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_iax2.c | 4 ++-- include/asterisk/sched.h | 3 ++- main/sched.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 15b58c7739..86775358fd 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1051,8 +1051,8 @@ static void __send_lagrq(const void *data) /* I am the schedule, so I'm allowed to do this */ iaxs[callno]->lagid = -1; } - } else if (option_debug > 0) { - ast_log(LOG_DEBUG, "I was supposed to send a LAGRQ with callno %d, but no such call exists (and I cannot remove lagid, either).\n", callno); + } else { + ast_log(LOG_WARNING, "I was supposed to send a LAGRQ with callno %d, but no such call exists (and I cannot remove lagid, either).\n", callno); } ast_mutex_unlock(&iaxsl[callno]); diff --git a/include/asterisk/sched.h b/include/asterisk/sched.h index d2508bfa81..6391a08083 100644 --- a/include/asterisk/sched.h +++ b/include/asterisk/sched.h @@ -118,7 +118,8 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal * \param id ID of the scheduled item to delete * \return Returns 0 on success, -1 on failure */ -int ast_sched_del(struct sched_context *con, int id); +int _ast_sched_del(struct sched_context *con, int id, const char *file, int line, const char *function); +#define ast_sched_del(a, b) _ast_sched_del(a, b, __FILE__, __LINE__, __PRETTY_FUNCTION__) /*! \brief Determines number of seconds until the next outstanding event to take place * Determine the number of seconds until the next outstanding event diff --git a/main/sched.c b/main/sched.c index f020aa1966..99c72c8d51 100644 --- a/main/sched.c +++ b/main/sched.c @@ -255,7 +255,7 @@ int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, co * would be two or more in the list with that * id. */ -int ast_sched_del(struct sched_context *con, int id) +int _ast_sched_del(struct sched_context *con, int id, const char *file, int line, const char *function) { struct sched *s; @@ -282,7 +282,7 @@ int ast_sched_del(struct sched_context *con, int id) if (!s) { if (option_debug) ast_log(LOG_DEBUG, "Attempted to delete nonexistent schedule entry %d!\n", id); - ast_assert(s != NULL); + _ast_assert(0, "s != NULL", file, line, function); return -1; }