[Asterisk-cvs] asterisk utils.c,1.14,1.15

markster at lists.digium.com markster at lists.digium.com
Tue Jun 29 14:08:33 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv18523

Modified Files:
	utils.c 
Log Message:
FreeBSD fix for utils (bug #1949)


Index: utils.c
===================================================================
RCS file: /usr/cvsroot/asterisk/utils.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- utils.c	29 Jun 2004 12:56:46 -0000	1.14
+++ utils.c	29 Jun 2004 17:54:25 -0000	1.15
@@ -14,6 +14,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <asterisk/lock.h>
 #include <asterisk/utils.h>
@@ -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);




More information about the svn-commits mailing list