summaryrefslogtreecommitdiff
path: root/devel/nspr/patches/patch-ad
blob: c14f06850420f968412765d22175a039f0e4c872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$NetBSD: patch-ad,v 1.3 2007/03/18 18:49:47 wiz Exp $

--- pr/src/misc/prnetdb.c.orig	2006-11-14 17:41:59.000000000 +0000
+++ pr/src/misc/prnetdb.c
@@ -2115,7 +2115,17 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInf
          */
         hints.ai_socktype = SOCK_STREAM;
 
+/* NetBSD >= 2.99.9 has a thread-safe resolver */
+#if defined(__NetBSD_Version__) && __NetBSD_Version__ < 299000900
+	LOCK_DNS();
+#endif
+
         rv = GETADDRINFO(hostname, NULL, &hints, &res);
+
+#if defined(__NetBSD_Version__) && __NetBSD_Version__ < 299000900
+	UNLOCK_DNS();
+#endif
+
         if (rv == 0)
             return (PRAddrInfo *) res;