aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-08-19 18:56:52 +0000
committerUlrich Drepper <drepper@redhat.com>2004-08-19 18:56:52 +0000
commit10b71c3d31c7a4fe437fdda6b5730479414e935a (patch)
tree3d509f8c0f00244f4025f2571a72261f3b1072b2
parentb6c0f679b1f8f918bbee34e2a8000dac0b9277dc (diff)
downloadglibc-10b71c3d31c7a4fe437fdda6b5730479414e935a.tar
glibc-10b71c3d31c7a4fe437fdda6b5730479414e935a.tar.gz
glibc-10b71c3d31c7a4fe437fdda6b5730479414e935a.tar.bz2
glibc-10b71c3d31c7a4fe437fdda6b5730479414e935a.zip
Update.
2004-08-19 Jakub Jelinek <jakub@redhat.com> * sysdeps/posix/getaddrinfo.c (gaih_inet): Cast canon to (char *) to avoid warning. * resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Initialize status to NSS_STATUS_UNAVAIL. 2004-08-19 Ulrich Drepper <drepper@redhat.com> * sysdeps/posix/getaddrinfo.c (gaih_inet): Use h->h_name in the cannoname lookup since it has the FQDN even if the original NAME value has not.
-rw-r--r--ChangeLog14
-rw-r--r--resolv/nss_dns/dns-canon.c2
-rw-r--r--sysdeps/posix/getaddrinfo.c9
3 files changed, 20 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e72af0230..3a2a65eaf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2004-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Cast canon to (char *)
+ to avoid warning.
+
+ * resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Initialize
+ status to NSS_STATUS_UNAVAIL.
+
+2004-08-19 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/posix/getaddrinfo.c (gaih_inet): Use h->h_name in the
+ cannoname lookup since it has the FQDN even if the original NAME
+ value has not.
+
2004-08-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/posix/getaddrinfo.c (gaih_inet): Store NAME parameter
diff --git a/resolv/nss_dns/dns-canon.c b/resolv/nss_dns/dns-canon.c
index ae3f40ba0a..91708df51f 100644
--- a/resolv/nss_dns/dns-canon.c
+++ b/resolv/nss_dns/dns-canon.c
@@ -52,7 +52,7 @@ _nss_dns_getcanonname_r (const char *name, char *buffer, size_t buflen,
querybuf *buf;
unsigned char *ptr;
} ansp = { .ptr = buf };
- enum nss_status status;
+ enum nss_status status = NSS_STATUS_UNAVAIL;
int qtypes[] = { ns_t_a, ns_t_aaaa };
#define nqtypes (sizeof (qtypes) / sizeof (qtypes[0]))
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index d72457af10..2d89b4ad5f 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -576,7 +576,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
if (at->family == AF_UNSPEC && (req->ai_flags & AI_NUMERICHOST) == 0)
{
- struct hostent *h;
+ struct hostent *h = NULL;
struct gaih_addrtuple **pat = &at;
int no_data = 0;
int no_inet6_data = 0;
@@ -656,8 +656,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
char *buf = alloca (max_fqdn_len);
char *s;
- if (DL_CALL_FCT (cfct, (name, buf, max_fqdn_len,
- &s, &rc, &herrno))
+ if (DL_CALL_FCT (cfct, (h->h_name ?: name, buf,
+ max_fqdn_len, &s, &rc,
+ &herrno))
== NSS_STATUS_SUCCESS)
canon = s;
else
@@ -856,7 +857,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
(*pai)->ai_addr = (void *) (*pai + 1);
/* We only add the canonical name once. */
- (*pai)->ai_canonname = canon;
+ (*pai)->ai_canonname = (char *) canon;
canon = NULL;
#if SALEN