diff options
author | sobomax <sobomax@FreeBSD.org> | 2003-10-17 11:22:52 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2003-10-17 11:22:52 +0000 |
commit | 833e5e373d9b0cf324df571c69ad7fe349abc376 (patch) | |
tree | dbc33242b36bcccbd6fc83b4cb58335a83063330 /net/asterisk10/files/patch-enum.c | |
parent | e2a21e1e7649b3fd2cee9922499262b285089df8 (diff) | |
download | FreeBSD-ports-833e5e373d9b0cf324df571c69ad7fe349abc376.zip FreeBSD-ports-833e5e373d9b0cf324df571c69ad7fe349abc376.tar.gz |
Add asterisk 0.5.0, an Open Source PBX and telephony toolkit.
Diffstat (limited to 'net/asterisk10/files/patch-enum.c')
-rw-r--r-- | net/asterisk10/files/patch-enum.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/net/asterisk10/files/patch-enum.c b/net/asterisk10/files/patch-enum.c new file mode 100644 index 0000000..fd5c7f9 --- /dev/null +++ b/net/asterisk10/files/patch-enum.c @@ -0,0 +1,40 @@ + +$FreeBSD$ + +--- enum.c.orig Mon Sep 1 18:36:52 2003 ++++ enum.c Fri Oct 17 11:27:30 2003 +@@ -380,9 +380,14 @@ + struct enum_search *s = NULL; + int version = -1; + struct __res_state enumstate; +- res_ninit(&enumstate); +- if (chan && ast_autoservice_start(chan) < 0) ++ static ast_mutex_t reslock = AST_MUTEX_INITIALIZER; ++ ++ ast_mutex_lock(&reslock); ++ res_init(); ++ if (chan && ast_autoservice_start(chan) < 0) { ++ ast_mutex_unlock(&reslock); + return -1; ++ } + + strncat(naptrinput, number, sizeof(naptrinput) - 2); + +@@ -411,7 +416,7 @@ + ast_mutex_unlock(&enumlock); + if (!s) + break; +- res = res_nsearch(&enumstate, tmp, C_IN, T_NAPTR, answer, sizeof(answer)); ++ res = res_search(tmp, C_IN, T_NAPTR, answer, sizeof(answer)); + if (res > 0) + break; + } +@@ -429,7 +434,7 @@ + } + if (chan) + ret |= ast_autoservice_stop(chan); +- res_nclose(&enumstate); ++ ast_mutex_unlock(&reslock); + return ret; + } + |