summaryrefslogtreecommitdiff
path: root/resolv
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-09-01 19:29:18 +0200
committerThomas Schwinge <thomas@codesourcery.com>2013-09-01 19:29:18 +0200
commitcbb58c37bb81d176f106a4de3c7f3b02dee2ff66 (patch)
treec746d229279f84aac0fe3afe537813fb281f7f78 /resolv
parentffeaf5a2df0d177a7780fd7c6f5e7595caba766a (diff)
parentd5860b5273bc00632c65b43cb931d3238db0ab57 (diff)
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Conflicts: sysdeps/mach/hurd/i386/init-first.c sysdeps/unix/sysv/linux/ldsodefs.h
Diffstat (limited to 'resolv')
-rw-r--r--resolv/Makefile16
-rw-r--r--resolv/README2
-rw-r--r--resolv/arpa/nameser.h12
-rw-r--r--resolv/gai_notify.c2
-rw-r--r--resolv/gethnamaddr.c32
-rw-r--r--resolv/ns_name.c4
-rw-r--r--resolv/ns_print.c2
-rw-r--r--resolv/ns_samedomain.c2
-rw-r--r--resolv/nss_dns/dns-host.c4
-rw-r--r--resolv/res_comp.c2
-rw-r--r--resolv/res_data.c2
-rw-r--r--resolv/res_debug.h2
-rw-r--r--resolv/res_hconf.c2
-rw-r--r--resolv/res_init.c8
-rw-r--r--resolv/res_libc.c4
-rw-r--r--resolv/res_mkquery.c7
-rw-r--r--resolv/res_send.c7
-rw-r--r--resolv/tst-inet_ntop.c2
18 files changed, 52 insertions, 60 deletions
diff --git a/resolv/Makefile b/resolv/Makefile
index d3635bc115..51dcf217af 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -83,23 +83,11 @@ CFLAGS-res_hconf.c = -fexceptions
# The BIND code elicits some harmless warnings.
+cflags += -Wno-strict-prototypes -Wno-write-strings
-# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
-# This ensures they will load libc.so for needed symbols if loaded by
-# a statically-linked program that hasn't already loaded it.
-$(objpfx)libresolv.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
-# Some hosts need '__stack_chk_guard', so pull in the definition from
-# ld.so if required.
-ifeq (yes,$(have-ssp))
-LDLIBS-resolv.so += $(as-needed) $(elfobjdir)/ld.so $(no-as-needed)
-endif
-
# The DNS NSS modules needs the resolver.
-$(objpfx)libnss_dns.so: $(objpfx)libresolv.so $(common-objpfx)libc.so \
- $(common-objpfx)libc_nonshared.a
+$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
# The asynchronous name lookup code needs the thread library.
-$(objpfx)libanl.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a \
- $(shared-thread-library)
+$(objpfx)libanl.so: $(shared-thread-library)
$(objpfx)ga_test: $(objpfx)libanl.so $(shared-thread-library)
diff --git a/resolv/README b/resolv/README
index 416205da77..dbb15108ae 100644
--- a/resolv/README
+++ b/resolv/README
@@ -62,7 +62,7 @@ the `gethostby*' family of functions, which means that for example
traditional resolver interfaces however, continue to use a single
resolver state and are therefore still thread-unsafe. The resolver
state is the same resolver state that is used for the initial ("main")
-thread.
+thread.
This has the following consequences for existing binaries and source
code:
diff --git a/resolv/arpa/nameser.h b/resolv/arpa/nameser.h
index 6a2c8376bd..fb8513ba9b 100644
--- a/resolv/arpa/nameser.h
+++ b/resolv/arpa/nameser.h
@@ -433,7 +433,7 @@ typedef enum __ns_cert_types {
* Inline versions of get/put short/long. Pointer is advanced.
*/
#define NS_GET16(s, cp) do { \
- register const u_char *t_cp = (const u_char *)(cp); \
+ const u_char *t_cp = (const u_char *)(cp); \
(s) = ((u_int16_t)t_cp[0] << 8) \
| ((u_int16_t)t_cp[1]) \
; \
@@ -441,7 +441,7 @@ typedef enum __ns_cert_types {
} while (0)
#define NS_GET32(l, cp) do { \
- register const u_char *t_cp = (const u_char *)(cp); \
+ const u_char *t_cp = (const u_char *)(cp); \
(l) = ((u_int32_t)t_cp[0] << 24) \
| ((u_int32_t)t_cp[1] << 16) \
| ((u_int32_t)t_cp[2] << 8) \
@@ -451,16 +451,16 @@ typedef enum __ns_cert_types {
} while (0)
#define NS_PUT16(s, cp) do { \
- register u_int16_t t_s = (u_int16_t)(s); \
- register u_char *t_cp = (u_char *)(cp); \
+ u_int16_t t_s = (u_int16_t)(s); \
+ u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_s >> 8; \
*t_cp = t_s; \
(cp) += NS_INT16SZ; \
} while (0)
#define NS_PUT32(l, cp) do { \
- register u_int32_t t_l = (u_int32_t)(l); \
- register u_char *t_cp = (u_char *)(cp); \
+ u_int32_t t_l = (u_int32_t)(l); \
+ u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_l >> 24; \
*t_cp++ = t_l >> 16; \
*t_cp++ = t_l >> 8; \
diff --git a/resolv/gai_notify.c b/resolv/gai_notify.c
index 9e4bdf6671..48cb58ab0d 100644
--- a/resolv/gai_notify.c
+++ b/resolv/gai_notify.c
@@ -117,7 +117,7 @@ __gai_notify (struct requestlist *req)
#endif
}
else
- /* This is part of a asynchronous `getaddrinfo_a' operation. If
+ /* This is part of an asynchronous `getaddrinfo_a' operation. If
this request is the last one, send the signal. */
if (--*waitlist->counterp == 0)
{
diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c
index a8ccf1fd3a..1fd8f92680 100644
--- a/resolv/gethnamaddr.c
+++ b/resolv/gethnamaddr.c
@@ -178,9 +178,9 @@ Dprintf(msg, num)
static struct hostent *
getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
{
- register const HEADER *hp;
- register const u_char *cp;
- register int n;
+ const HEADER *hp;
+ const u_char *cp;
+ int n;
const u_char *eom, *erdata;
char *bp, **ap, **hap;
int type, class, buflen, ancount, qdcount;
@@ -409,7 +409,7 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
continue;
}
if (!haveanswer) {
- register int nn;
+ int nn;
host.h_name = bp;
nn = strlen(bp) + 1; /* for the \0 */
@@ -514,7 +514,7 @@ gethostbyname2(name, af)
u_char *ptr;
} buf;
querybuf *origbuf;
- register const char *cp;
+ const char *cp;
char *bp;
int n, size, type, len;
struct hostent *ret;
@@ -653,10 +653,10 @@ gethostbyaddr(addr, len, af)
u_char *ptr;
} buf;
querybuf *orig_buf;
- register struct hostent *hp;
+ struct hostent *hp;
char qbuf[MAXDNAME+1], *qp = NULL;
#ifdef SUNSECURITY
- register struct hostent *rhp;
+ struct hostent *rhp;
char **haddr;
u_long old_options;
char hname2[MAXDNAME+1];
@@ -795,7 +795,7 @@ _sethtent(f)
libresolv_hidden_def (_sethtent)
void
-_endhtent()
+_endhtent (void)
{
if (hostf && !stayopen) {
(void) fclose(hostf);
@@ -804,10 +804,10 @@ _endhtent()
}
struct hostent *
-_gethtent()
+_gethtent (void)
{
char *p;
- register char *cp, **q;
+ char *cp, **q;
int af, len;
if (!hostf && !(hostf = fopen(_PATH_HOSTS, "rce" ))) {
@@ -888,8 +888,8 @@ _gethtbyname2(name, af)
const char *name;
int af;
{
- register struct hostent *p;
- register char **cp;
+ struct hostent *p;
+ char **cp;
_sethtent(0);
while ((p = _gethtent())) {
@@ -913,7 +913,7 @@ _gethtbyaddr(addr, len, af)
size_t len;
int af;
{
- register struct hostent *p;
+ struct hostent *p;
_sethtent(0);
while ((p = _gethtent()))
@@ -1028,7 +1028,7 @@ ht_sethostent(stayopen)
}
void
-ht_endhostent()
+ht_endhostent (void)
{
_endhtent();
}
@@ -1050,13 +1050,13 @@ ht_gethostbyaddr(addr, len, af)
}
struct hostent *
-gethostent()
+gethostent (void)
{
return (_gethtent());
}
void
-dns_service()
+dns_service (void)
{
return;
}
diff --git a/resolv/ns_name.c b/resolv/ns_name.c
index adf64bbd9a..f355cf3444 100644
--- a/resolv/ns_name.c
+++ b/resolv/ns_name.c
@@ -180,7 +180,7 @@ libresolv_hidden_def (ns_name_ntop)
strong_alias (ns_name_ntop, __ns_name_ntop)
/*%
- * Convert a ascii string into an encoded domain name as per RFC1035.
+ * Convert an ascii string into an encoded domain name as per RFC1035.
*
* return:
*
@@ -681,7 +681,7 @@ libresolv_hidden_def (ns_name_skip)
/*%
* Thinking in noninternationalized USASCII (per the DNS spec),
- * is this characted special ("in need of quoting") ?
+ * is this character special ("in need of quoting") ?
*
* return:
*\li boolean.
diff --git a/resolv/ns_print.c b/resolv/ns_print.c
index 36d39784a5..800680d371 100644
--- a/resolv/ns_print.c
+++ b/resolv/ns_print.c
@@ -935,7 +935,7 @@ dst_s_id_calc(const u_char *key, const int keysize)
static u_int16_t
dst_s_get_int16(const u_char *buf)
{
- register u_int16_t a = 0;
+ u_int16_t a = 0;
a = ((u_int16_t)(buf[0] << 8)) | ((u_int16_t)(buf[1]));
return (a);
}
diff --git a/resolv/ns_samedomain.c b/resolv/ns_samedomain.c
index 44b843a74b..df6a4a26fb 100644
--- a/resolv/ns_samedomain.c
+++ b/resolv/ns_samedomain.c
@@ -29,7 +29,7 @@ static const char rcsid[] = "$BINDId: ns_samedomain.c,v 8.9 1999/10/15 21:06:51
* Check whether a name belongs to a domain.
*
* Inputs:
- *\li a - the domain whose ancestory is being verified
+ *\li a - the domain whose ancestry is being verified
*\li b - the potential ancestor we're checking against
*
* Return:
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index af5c166da9..9018bb98a6 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -601,7 +601,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
char *h_addr_ptrs[0];
} *host_data;
int linebuflen;
- register const HEADER *hp;
+ const HEADER *hp;
const u_char *end_of_message, *cp;
int n, ancount, qdcount;
int haveanswer, had_error;
@@ -920,7 +920,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
}
if (!haveanswer)
{
- register int nn;
+ int nn;
/* We compose a single hostent out of the entire chain of
entries, so the TTL of the hostent is essentially the lowest
diff --git a/resolv/res_comp.c b/resolv/res_comp.c
index c7212fab11..2ff7ddb1cd 100644
--- a/resolv/res_comp.c
+++ b/resolv/res_comp.c
@@ -81,7 +81,7 @@ static const char rcsid[] = "$BINDId: res_comp.c,v 8.15 1999/10/13 16:39:39 vixi
/*
* Expand compressed domain name 'comp_dn' to full domain name.
- * 'msg' is a pointer to the begining of the message,
+ * 'msg' is a pointer to the beginning of the message,
* 'eomorig' points to the first location after the message,
* 'exp_dn' is a pointer to a buffer of size 'length' for the result.
* Return size of compressed name or -1 if there was an error.
diff --git a/resolv/res_data.c b/resolv/res_data.c
index 1beea1dc4f..81c9ae5bfd 100644
--- a/resolv/res_data.c
+++ b/resolv/res_data.c
@@ -236,7 +236,7 @@ res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key,
void
res_close(void) {
#ifdef _LIBC
- /*
+ /*
* Some stupid programs out there call res_close() before res_init().
* Since _res._vcsock isn't explicitly initialized, these means that
* we could do a close(0), which might lead to some security problems.
diff --git a/resolv/res_debug.h b/resolv/res_debug.h
index 4a0aa99ab4..2d8ad15d60 100644
--- a/resolv/res_debug.h
+++ b/resolv/res_debug.h
@@ -31,4 +31,4 @@
} else {}
#endif
-#endif /* _RES_DEBUG_H_ */
+#endif /* _RES_DEBUG_H_ */
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index 8ac46380a3..a92751b873 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -359,6 +359,7 @@ _res_hconf_init (void)
#ifndef NOT_IN_libc
+# if defined SIOCGIFCONF && defined SIOCGIFNETMASK
/* List of known interfaces. */
libc_freeres_ptr (
static struct netaddr
@@ -373,6 +374,7 @@ static struct netaddr
} ipv4;
} u;
} *ifaddrs);
+# endif
/* Reorder addresses returned in a hostent such that the first address
is an address on the local subnet, if there is such an address.
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 002dec5c57..5e1a747a4a 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -149,9 +149,9 @@ libc_hidden_def (__res_ninit)
/* This function has to be reachable by res_data.c but not publically. */
int
__res_vinit(res_state statp, int preinit) {
- register FILE *fp;
- register char *cp, **pp;
- register int n;
+ FILE *fp;
+ char *cp, **pp;
+ int n;
char buf[BUFSIZ];
int nserv = 0; /* number of nameserver records read from file */
#ifdef _LIBC
@@ -571,7 +571,7 @@ static u_int32_t
net_mask(in) /* XXX - should really use system's version of this */
struct in_addr in;
{
- register u_int32_t i = ntohl(in.s_addr);
+ u_int32_t i = ntohl(in.s_addr);
if (IN_CLASSA(i))
return (htonl(IN_CLASSA_NET));
diff --git a/resolv/res_libc.c b/resolv/res_libc.c
index 48d3200b7e..0b37f46aea 100644
--- a/resolv/res_libc.c
+++ b/resolv/res_libc.c
@@ -122,9 +122,7 @@ libc_hidden_def (__res_maybe_init)
This differs from plain `struct __res_state _res;' in that it doesn't
create a common definition, but a plain symbol that resides in .bss,
which can have an alias. */
-struct __res_state _res __attribute__((section (".bss")));
-
-#include <tls.h>
+struct __res_state _res __attribute__ ((nocommon));
#undef __resp
__thread struct __res_state *__resp = &_res;
diff --git a/resolv/res_mkquery.c b/resolv/res_mkquery.c
index e2c6a742c0..6170763fa3 100644
--- a/resolv/res_mkquery.c
+++ b/resolv/res_mkquery.c
@@ -77,6 +77,7 @@ static const char rcsid[] = "$BINDId: res_mkquery.c,v 8.12 1999/10/13 16:39:40 v
#include <resolv.h>
#include <stdio.h>
#include <string.h>
+#include <sys/time.h>
/* Options. Leave them on. */
/* #define DEBUG */
@@ -104,9 +105,9 @@ res_nmkquery(res_state statp,
u_char *buf, /* buffer to put query */
int buflen) /* size of buffer */
{
- register HEADER *hp;
- register u_char *cp;
- register int n;
+ HEADER *hp;
+ u_char *cp;
+ int n;
u_char *dnptrs[20], **dpp, **lastdnptr;
#ifdef DEBUG
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 60da5c901b..5a73696e55 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -875,7 +875,7 @@ send_vc(res_state statp,
}
}
/*
- * If the calling applicating has bailed out of
+ * If the calling application has bailed out of
* a previous call and failed to arrange to have
* the circuit closed or the server has got
* itself confused, then drop the packet and
@@ -1229,8 +1229,11 @@ send_dg(res_state statp,
/* Yes, we test ANSCP here. If we have two buffers
both will be allocatable. */
&& anscp
+#ifdef FIONREAD
&& (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0
- || *thisanssizp < *thisresplenp)) {
+ || *thisanssizp < *thisresplenp)
+#endif
+ ) {
u_char *newp = malloc (MAXPACKET);
if (newp != NULL) {
*anssizp = MAXPACKET;
diff --git a/resolv/tst-inet_ntop.c b/resolv/tst-inet_ntop.c
index a042c74c91..f968ec4dcb 100644
--- a/resolv/tst-inet_ntop.c
+++ b/resolv/tst-inet_ntop.c
@@ -106,6 +106,6 @@ main (void)
result++;
}
-
+
return result;
}