aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/lock.h
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-27 13:54:13 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-27 13:54:13 +0000
commit17b8ca89d92dec4e70de82e74fcf1246b36a172f (patch)
tree351f4bd4128bc9eebc72d7ad02da29a21b2bc62e /include/asterisk/lock.h
parent31c979ade9b24dad9580dd485fe75e6a399b4140 (diff)
Merged revisions 125793 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r125793 | tilghman | 2008-06-27 08:45:03 -0500 (Fri, 27 Jun 2008) | 2 lines In this debugging function, copy to a buffer instead of using potentially unsafe pointers. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@125794 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/lock.h')
-rw-r--r--include/asterisk/lock.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index 46c72382e..56f7b03f0 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -250,9 +250,9 @@ void log_show_lock(void *this_lock_addr);
* be preserved as to what location originally acquired the lock.
*/
#if !defined(LOW_MEMORY)
-int ast_find_lock_info(void *lock_addr, const char **filename, int *lineno, const char **func, const char **mutex_name);
+int ast_find_lock_info(void *lock_addr, char *filename, size_t filename_size, int *lineno, char *func, size_t func_size, char *mutex_name, size_t mutex_name_size);
#else
-#define ast_find_lock_info(a,b,c,d,e) -1
+#define ast_find_lock_info(a,b,c,d,e,f,g,h) -1
#endif
/*!
@@ -263,9 +263,9 @@ int ast_find_lock_info(void *lock_addr, const char **filename, int *lineno, cons
*/
#define CHANNEL_DEADLOCK_AVOIDANCE(chan) \
do { \
- const char *__filename, *__func, *__mutex_name; \
+ char __filename[80], __func[80], __mutex_name[80]; \
int __lineno; \
- int __res = ast_find_lock_info(&chan->lock_dont_use, &__filename, &__lineno, &__func, &__mutex_name); \
+ int __res = ast_find_lock_info(&chan->lock_dont_use, __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \
ast_channel_unlock(chan); \
usleep(1); \
if (__res < 0) { /* Shouldn't ever happen, but just in case... */ \
@@ -277,9 +277,9 @@ int ast_find_lock_info(void *lock_addr, const char **filename, int *lineno, cons
#define DEADLOCK_AVOIDANCE(lock) \
do { \
- const char *__filename, *__func, *__mutex_name; \
+ char __filename[80], __func[80], __mutex_name[80]; \
int __lineno; \
- int __res = ast_find_lock_info(lock, &__filename, &__lineno, &__func, &__mutex_name); \
+ int __res = ast_find_lock_info(lock, __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \
ast_mutex_unlock(lock); \
usleep(1); \
if (__res < 0) { /* Shouldn't ever happen, but just in case... */ \
@@ -291,9 +291,9 @@ int ast_find_lock_info(void *lock_addr, const char **filename, int *lineno, cons
#define DLA_UNLOCK(lock) \
do { \
- const char *__filename, *__func, *__mutex_name; \
+ char __filename[80], __func[80], __mutex_name[80]; \
int __lineno; \
- int __res = ast_find_lock_info(lock, &__filename, &__lineno, &__func, &__mutex_name); \
+ int __res = ast_find_lock_info(lock, __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \
ast_mutex_unlock(lock);
#define DLA_LOCK(lock) \