summaryrefslogtreecommitdiff
path: root/net/asterisk/files/patch-srv.c
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2003-10-17 11:22:52 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2003-10-17 11:22:52 +0000
commitf01a970a4ec80d0f3ed1b1bdb091b764dcbde9b2 (patch)
tree0aca8a0e8a5d8ec07e8780b50ba45ca50b749e1f /net/asterisk/files/patch-srv.c
parentThe port depends on an include file, not on a library. Revert back (diff)
Add asterisk 0.5.0, an Open Source PBX and telephony toolkit.
Notes
Notes: svn path=/head/; revision=91503
Diffstat (limited to 'net/asterisk/files/patch-srv.c')
-rw-r--r--net/asterisk/files/patch-srv.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/net/asterisk/files/patch-srv.c b/net/asterisk/files/patch-srv.c
new file mode 100644
index 000000000000..3cbb534f1b22
--- /dev/null
+++ b/net/asterisk/files/patch-srv.c
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- srv.c.orig Thu Aug 14 02:56:16 2003
++++ srv.c Fri Oct 17 11:27:30 2003
+@@ -246,13 +246,17 @@
+ int ret = -1;
+ struct __res_state srvstate;
+ char answer[MAX_SIZE];
++ static ast_mutex_t reslock = AST_MUTEX_INITIALIZER;
+
+ if (*port)
+ *port = 0;
+- res_ninit(&srvstate);
+- if (chan && ast_autoservice_start(chan) < 0)
++ ast_mutex_lock(&reslock);
++ res_init();
++ if (chan && ast_autoservice_start(chan) < 0) {
++ ast_mutex_unlock(&reslock);
+ return -1;
+- res = res_nsearch(&srvstate, service, C_IN, T_SRV, answer, sizeof(answer));
++ }
++ res = res_search(service, C_IN, T_SRV, answer, sizeof(answer));
+ if (res > 0) {
+ if ((res = parse_answer(host, hostlen, port, answer, res))) {
+ ast_log(LOG_WARNING, "Parse error returned %d\n", res);
+@@ -267,6 +271,6 @@
+ }
+ if (chan)
+ ret |= ast_autoservice_stop(chan);
+- res_nclose(&srvstate);
++ ast_mutex_unlock(&reslock);
+ return ret;
+ }