mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +00:00
Merge FreeBSD locking fixes (bug #1411)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
3
utils.c
3
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user