Merge a new implementation of ast_inet_ntoa, our thread safe replacement for

inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-07-21 17:31:28 +00:00
parent 1861dcdff5
commit ca9ba719b6
19 changed files with 338 additions and 454 deletions

View File

@@ -123,7 +123,6 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i
{
int netsocket = -1;
int *ioref;
char iabuf[INET_ADDRSTRLEN];
struct ast_netsock *ns;
@@ -135,7 +134,7 @@ struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct i
return NULL;
}
if (bind(netsocket,(struct sockaddr *)bindaddr, sizeof(struct sockaddr_in))) {
ast_log(LOG_ERROR, "Unable to bind to %s port %d: %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr->sin_addr), ntohs(bindaddr->sin_port), strerror(errno));
ast_log(LOG_ERROR, "Unable to bind to %s port %d: %s\n", ast_inet_ntoa(bindaddr->sin_addr), ntohs(bindaddr->sin_port), strerror(errno));
close(netsocket);
return NULL;
}