summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-04-15 18:15:12 +0000
committerume <ume@FreeBSD.org>2005-04-15 18:15:12 +0000
commitaedac4ef3ab03e1e1b44810db3827f38bf5f5289 (patch)
tree66fcd4ab2500e22a753a79200fe36c3296f27f1c /lib
parent0e0eae8d50404b8ab351262f4842141ecad7c8bf (diff)
downloadFreeBSD-src-aedac4ef3ab03e1e1b44810db3827f38bf5f5289.zip
FreeBSD-src-aedac4ef3ab03e1e1b44810db3827f38bf5f5289.tar.gz
Now, our getservbyname(3) is thread-safe. So, we don't need
to protect it with mutex lock.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/getaddrinfo.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 8e7f566..0265dd6 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -66,7 +66,6 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
-#include "reentrant.h"
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
@@ -286,14 +285,6 @@ static int res_searchN(const char *, struct res_target *);
static int res_querydomainN(const char *, const char *,
struct res_target *);
-/*
- * XXX: Many dependencies are not thread-safe. Still, we cannot use
- * getaddrinfo() in conjunction with other functions which call them.
- */
-static mutex_t _getaddrinfo_thread_lock = MUTEX_INITIALIZER;
-#define THREAD_LOCK() mutex_lock(&_getaddrinfo_thread_lock);
-#define THREAD_UNLOCK() mutex_unlock(&_getaddrinfo_thread_lock);
-
/* XXX macros that make external reference is BAD. */
#define GET_AI(ai, afd, addr) \
@@ -1441,13 +1432,9 @@ get_port(ai, servname, matchonly)
break;
}
- THREAD_LOCK();
- if ((sp = getservbyname(servname, proto)) == NULL) {
- THREAD_UNLOCK();
+ if ((sp = getservbyname(servname, proto)) == NULL)
return EAI_SERVICE;
- }
port = sp->s_port;
- THREAD_UNLOCK();
}
if (!matchonly) {
OpenPOWER on IntegriCloud