Index: utils.c =================================================================== RCS file: /usr/cvsroot/asterisk/utils.c,v retrieving revision 1.14 diff -u -r1.14 utils.c --- utils.c 29 Jun 2004 12:56:46 -0000 1.14 +++ utils.c 29 Jun 2004 18:48:05 -0000 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -29,6 +30,7 @@ AST_MUTEX_DEFINE_STATIC(__mutex); +/* Recursive replacement for gethostbyname for BSD-based systems */ static int gethostbyname_r (const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop) @@ -126,6 +128,9 @@ #endif +/* Recursive thread safe version of gethostbyname that replaces the + standard gethostbyname (which is not recursive) +*/ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp) { int res; @@ -328,6 +333,7 @@ #endif } +/* Recursive thread safe replacement of inet_ntoa */ const char *ast_inet_ntoa(char *buf, int bufsiz, struct in_addr ia) { return inet_ntop(AF_INET, &ia, buf, bufsiz); Index: include/asterisk/utils.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/utils.h,v retrieving revision 1.5 diff -u -r1.5 utils.h --- include/asterisk/utils.h 29 Jun 2004 12:56:46 -0000 1.5 +++ include/asterisk/utils.h 29 Jun 2004 18:48:06 -0000 @@ -32,6 +32,9 @@ extern const char *ast_inet_ntoa(char *buf, int bufsiz, struct in_addr ia); extern int ast_utils_init(void); +#ifdef inet_ntoa +#undef inet_ntoa +#endif #define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__ #endif