]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(nscd_gethst_r): Avoid unnecesary read call if there are no aliases.
authorUlrich Drepper <drepper@redhat.com>
Sat, 19 Nov 2005 17:09:03 +0000 (17:09 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 19 Nov 2005 17:09:03 +0000 (17:09 +0000)
nscd/nscd_gethst_r.c

index 70ee38b71f286afe3122a433ae8ad8d00c04f79f..9fa10e27400006f6a3744f79c09d5d291bbbb65c 100644 (file)
@@ -328,8 +328,9 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
       /* And finally read the aliases.  */
       if (addr_list == NULL)
        {
-         if ((size_t) __readall (sock, resultbuf->h_aliases[0], total_len)
-             == total_len)
+         if (total_len == 0
+             || ((size_t) __readall (sock, resultbuf->h_aliases[0], total_len)
+                 == total_len))
            {
              retval = 0;
              *result = resultbuf;