summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-06-09 01:45:08 +0000
committerMark Spencer <markster@digium.com>2004-06-09 01:45:08 +0000
commit727abcdec7ad92fc2fae2585c5c609e0663858a6 (patch)
treee9c8ee99dcb97720b3dfb49c87b2f2c0b6f6f6b6 /utils.c
parentc96046b6c2c34b77bcc8a86ab5816c092d21bd7b (diff)
Merge FreeBSD locking fixes (bug #1411)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'utils.c')
-rwxr-xr-xutils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index a1ecb139b..37ffcb0bd 100755
--- a/utils.c
+++ b/utils.c
@@ -20,13 +20,14 @@
#define ERANGE 34
#undef gethostbyname
+AST_MUTEX_DEFINE_STATIC(__mutex);
+
int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
size_t buflen, struct hostent **result,
int *h_errnop)
{
int hsave;
struct hostent *ph;
- static ast_mutex_t __mutex = AST_MUTEX_INITIALIZER;
ast_mutex_lock(&__mutex); /* begin critical area */
hsave = h_errno;