gethostbyname isn't reentrant, who knew...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-04-22 00:20:34 +00:00
parent ca493a14e1
commit d3f9887589
12 changed files with 71 additions and 35 deletions

View File

@@ -250,6 +250,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
struct localuser *u;
struct sockaddr_in serv_addr;
struct hostent *serverhost;
struct ast_hostent ahp;
int fd;
FILE *fs;
char *host;
@@ -330,7 +331,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
memset(&serv_addr, 0, sizeof(serv_addr));
if ((serv_addr.sin_addr.s_addr = inet_addr(host)) == -1) {
/* its a name rather than an ipnum */
serverhost = gethostbyname(host);
serverhost = ast_gethostbyname(host, &ahp);
if (serverhost == (struct hostent *)0) {
ast_log(LOG_WARNING,"festival_client: gethostbyname failed\n");
return -1;