aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2006-12-15 20:49:44 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2006-12-15 20:49:44 +0000
commit3f25740ec6845340de7abaae80607dea9c3a4bb8 (patch)
tree98ad4d99a031d8761bab0970ed88904bab483af2 /lib/libc
parent7c35eabcb2ff31ab013324d5a4c3ff485c16ef32 (diff)
downloadsrc-3f25740ec6845340de7abaae80607dea9c3a4bb8.tar.gz
src-3f25740ec6845340de7abaae80607dea9c3a4bb8.zip
Vendor import of BIND 9.3.3
Notes
Notes: svn path=/vendor/resolver/dist/; revision=165254
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/inet/inet_cidr_ntop.c10
-rw-r--r--lib/libc/inet/inet_net_ntop.c4
-rw-r--r--lib/libc/isc/eventlib_p.h4
-rw-r--r--lib/libc/resolv/mtctxres.c7
-rw-r--r--lib/libc/resolv/res_init.c17
-rw-r--r--lib/libc/resolv/res_send.c5
6 files changed, 22 insertions, 25 deletions
diff --git a/lib/libc/inet/inet_cidr_ntop.c b/lib/libc/inet/inet_cidr_ntop.c
index 192cf1e752ef..b25dc8256f61 100644
--- a/lib/libc/inet/inet_cidr_ntop.c
+++ b/lib/libc/inet/inet_cidr_ntop.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.1.2.1.8.3 2005/11/03 23:08:40 marka Exp $";
+static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.1.2.1.8.4 2006/10/11 02:32:50 marka Exp $";
#endif
#include "port_before.h"
@@ -40,10 +40,10 @@ static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.1.2.1.8.3 2005/11/03 23:0
# define SPRINTF(x) ((size_t)sprintf x)
#endif
-static char * inet_cidr_ntop_ipv4 __P((const u_char *src, int bits,
- char *dst, size_t size));
-static char * inet_cidr_ntop_ipv6 __P((const u_char *src, int bits,
- char *dst, size_t size));
+static char *
+inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size);
+static char *
+inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size);
/*
* char *
diff --git a/lib/libc/inet/inet_net_ntop.c b/lib/libc/inet/inet_net_ntop.c
index f508629d617a..47af6284ede3 100644
--- a/lib/libc/inet/inet_net_ntop.c
+++ b/lib/libc/inet/inet_net_ntop.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.1.2.1.8.1 2004/03/09 08:33:32 marka Exp $";
+static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.1.2.1.8.2 2006/06/20 02:53:07 marka Exp $";
#endif
#include "port_before.h"
@@ -264,7 +264,7 @@ inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) {
}
}
/* Format CIDR /width. */
- SPRINTF((cp, "/%u", bits));
+ sprintf(cp, "/%u", bits);
if (strlen(outbuf) + 1 > size)
goto emsgsize;
strcpy(dst, outbuf);
diff --git a/lib/libc/isc/eventlib_p.h b/lib/libc/isc/eventlib_p.h
index b95741d7aff3..5c45ab83f60f 100644
--- a/lib/libc/isc/eventlib_p.h
+++ b/lib/libc/isc/eventlib_p.h
@@ -18,7 +18,7 @@
/* eventlib_p.h - private interfaces for eventlib
* vix 09sep95 [initial]
*
- * $Id: eventlib_p.h,v 1.3.2.1.4.3 2005/07/28 07:43:20 marka Exp $
+ * $Id: eventlib_p.h,v 1.3.2.1.4.4 2006/03/10 00:17:21 marka Exp $
*/
#ifndef _EVENTLIB_P_H
@@ -45,6 +45,8 @@
#define EV_MASK_ALL (EV_READ | EV_WRITE | EV_EXCEPT)
#define EV_ERR(e) return (errno = (e), -1)
#define OK(x) if ((x) < 0) EV_ERR(errno); else (void)NULL
+#define OKFREE(x, y) if ((x) < 0) { FREE((y)); EV_ERR(errno); } \
+ else (void)NULL
#define NEW(p) if (((p) = memget(sizeof *(p))) != NULL) \
FILL(p); \
diff --git a/lib/libc/resolv/mtctxres.c b/lib/libc/resolv/mtctxres.c
index f33cf11e3f42..635bbd4400f4 100644
--- a/lib/libc/resolv/mtctxres.c
+++ b/lib/libc/resolv/mtctxres.c
@@ -106,9 +106,10 @@ ___mtctxres(void) {
*/
if (!mt_key_initialized) {
static pthread_mutex_t keylock = PTHREAD_MUTEX_INITIALIZER;
- pthread_mutex_lock(&keylock);
- _mtctxres_init();
- pthread_mutex_unlock(&keylock);
+ if (pthread_mutex_lock(&keylock) == 0) {
+ _mtctxres_init();
+ (void) pthread_mutex_unlock(&keylock);
+ }
}
/*
diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c
index 28a3ebd088e9..fd82e87203c0 100644
--- a/lib/libc/resolv/res_init.c
+++ b/lib/libc/resolv/res_init.c
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.5 2005/11/03 00:00:52 marka Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.6 2006/08/30 23:23:01 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -237,17 +237,10 @@ __res_vinit(res_state statp, int preinit) {
if (buf[0] == '+')
buf[0] = '.';
cp = strchr(buf, '.');
- if (cp == NULL) {
- if (strlcpy(statp->defdname, buf,
- sizeof(statp->defdname))
- >= sizeof(statp->defdname))
- goto freedata;
- } else {
- if (strlcpy(statp->defdname, cp+1,
- sizeof(statp->defdname))
- >= sizeof(statp->defdname))
- goto freedata;
- }
+ cp = (cp == NULL) ? buf : (cp + 1);
+ if (strlen(cp) >= sizeof(statp->defdname))
+ goto freedata;
+ strcpy(statp->defdname, cp);
}
}
#endif /* SOLARIS2 */
diff --git a/lib/libc/resolv/res_send.c b/lib/libc/resolv/res_send.c
index 24527ead481d..c47dd49bc6e8 100644
--- a/lib/libc/resolv/res_send.c
+++ b/lib/libc/resolv/res_send.c
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.8 2006/03/08 04:13:31 marka Exp $";
+static const char rcsid[] = "$Id: res_send.c,v 1.5.2.2.4.9 2006/10/16 23:00:50 marka Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -295,7 +295,8 @@ res_nsend(res_state statp,
highestFD = sysconf(_SC_OPEN_MAX) - 1;
#endif
- if (statp->nscount == 0) {
+ /* No name servers or res_init() failure */
+ if (statp->nscount == 0 || EXT(statp).ext == NULL) {
errno = ESRCH;
return (-1);
}