git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3121 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
cd8e03c0b7
commit
bc5de50bc9
|
@ -17,6 +17,11 @@ MODS=cdr_csv.so
|
||||||
|
|
||||||
CFLAGS+=-fPIC
|
CFLAGS+=-fPIC
|
||||||
|
|
||||||
|
OSARCH=$(shell uname -s)
|
||||||
|
ifeq (${OSARCH},FreeBSD)
|
||||||
|
SOLINK+=-L/usr/local/lib
|
||||||
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# unixODBC stuff...
|
# unixODBC stuff...
|
||||||
#
|
#
|
||||||
|
|
|
@ -49,6 +49,10 @@ endif
|
||||||
ifneq (${OSARCH},Darwin)
|
ifneq (${OSARCH},Darwin)
|
||||||
CHANNEL_LIBS+=chan_oss.so
|
CHANNEL_LIBS+=chan_oss.so
|
||||||
endif
|
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 /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
|
||||||
CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
|
CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
|
||||||
|
|
5
dns.c
5
dns.c
|
@ -154,8 +154,11 @@ static int dns_parse_answer(void *context,
|
||||||
#if defined(res_ninit)
|
#if defined(res_ninit)
|
||||||
#define HAS_RES_NINIT
|
#define HAS_RES_NINIT
|
||||||
#else
|
#else
|
||||||
|
static ast_mutex_t res_lock = AST_MUTEX_INITIALIZER;
|
||||||
|
#if 0
|
||||||
#warning "Warning, res_ninit is missing... Could have reentrancy issues"
|
#warning "Warning, res_ninit is missing... Could have reentrancy issues"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
int ast_search_dns(void *context,
|
int ast_search_dns(void *context,
|
||||||
const char *dname, int class, int type,
|
const char *dname, int class, int type,
|
||||||
|
@ -171,6 +174,7 @@ int ast_search_dns(void *context,
|
||||||
res_ninit(&dnsstate);
|
res_ninit(&dnsstate);
|
||||||
res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
|
res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
|
||||||
#else
|
#else
|
||||||
|
ast_mutex_lock(&res_lock);
|
||||||
res_init();
|
res_init();
|
||||||
res = res_search(dname, class, type, answer, sizeof(answer));
|
res = res_search(dname, class, type, answer, sizeof(answer));
|
||||||
#endif
|
#endif
|
||||||
|
@ -192,6 +196,7 @@ int ast_search_dns(void *context,
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
res_close();
|
res_close();
|
||||||
#endif
|
#endif
|
||||||
|
ast_mutex_unlock(&res_lock);
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue