From: Mark Spencer Date: Mon, 31 May 2004 19:40:23 +0000 (+0000) Subject: More BSD compile fixes (bugs #1754 and #1756) X-Git-Tag: 1.0.0-rc1~334 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9286f2c6d315aad3adacb4f526dd27e0d67a1689;p=thirdparty%2Fasterisk.git More BSD compile fixes (bugs #1754 and #1756) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3121 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/cdr/Makefile b/cdr/Makefile index d688725f06..6b92e27d91 100755 --- a/cdr/Makefile +++ b/cdr/Makefile @@ -17,6 +17,11 @@ MODS=cdr_csv.so CFLAGS+=-fPIC +OSARCH=$(shell uname -s) +ifeq (${OSARCH},FreeBSD) +SOLINK+=-L/usr/local/lib +endif + # # unixODBC stuff... # diff --git a/channels/Makefile b/channels/Makefile index 40f5024f24..fd0b796e5e 100755 --- a/channels/Makefile +++ b/channels/Makefile @@ -49,6 +49,10 @@ endif ifneq (${OSARCH},Darwin) CHANNEL_LIBS+=chan_oss.so endif +ifeq (${OSARCH},FreeBSD) +SOLINK+=-L/usr/local/lib +CHANNEL_LIBS+=chan_oss.so +endif CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so) CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so) diff --git a/dns.c b/dns.c index 33974aa14f..0ec7d6d51a 100755 --- a/dns.c +++ b/dns.c @@ -154,8 +154,11 @@ static int dns_parse_answer(void *context, #if defined(res_ninit) #define HAS_RES_NINIT #else +static ast_mutex_t res_lock = AST_MUTEX_INITIALIZER; +#if 0 #warning "Warning, res_ninit is missing... Could have reentrancy issues" #endif +#endif int ast_search_dns(void *context, const char *dname, int class, int type, @@ -171,6 +174,7 @@ int ast_search_dns(void *context, res_ninit(&dnsstate); res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer)); #else + ast_mutex_lock(&res_lock); res_init(); res = res_search(dname, class, type, answer, sizeof(answer)); #endif @@ -192,6 +196,7 @@ int ast_search_dns(void *context, #ifndef __APPLE__ res_close(); #endif + ast_mutex_unlock(&res_lock); #endif return ret; }