mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 08:11:21 +00:00
More FreeBSD fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1702,8 +1702,8 @@ int gethostbyname_r (const char *name,
|
|||||||
|
|
||||||
int hsave;
|
int hsave;
|
||||||
struct hostent *ph;
|
struct hostent *ph;
|
||||||
static pthread_mutex_t __mutex = PTHREAD_MUTEX_INITIALIZER;
|
static ast_mutex_t __mutex = AST_MUTEX_INITIALIZER;
|
||||||
pthread_mutex_lock(&__mutex); /* begin critical area */
|
ast_mutex_lock(&__mutex); /* begin critical area */
|
||||||
hsave = h_errno;
|
hsave = h_errno;
|
||||||
|
|
||||||
ph = gethostbyname(name);
|
ph = gethostbyname(name);
|
||||||
@@ -1789,9 +1789,9 @@ int gethostbyname_r (const char *name,
|
|||||||
}
|
}
|
||||||
h_errno = hsave; /* restore h_errno */
|
h_errno = hsave; /* restore h_errno */
|
||||||
|
|
||||||
pthread_mutex_unlock(&__mutex); /* end critical area */
|
ast_mutex_unlock(&__mutex); /* end critical area */
|
||||||
|
|
||||||
return (*result == NULL);
|
return (*result != NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user