aboutsummaryrefslogtreecommitdiff
path: root/nscd
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-11-19 17:09:03 +0000
committerUlrich Drepper <drepper@redhat.com>2005-11-19 17:09:03 +0000
commit74ac0a89d27d1bff7238ecb14dd0a5009c2f479b (patch)
tree0dd75b105f7ea3083d0e4399b218af281998891d /nscd
parentd11edae6f2d12b37b7c3edc872f43a9ed88afe18 (diff)
downloadglibc-74ac0a89d27d1bff7238ecb14dd0a5009c2f479b.tar
glibc-74ac0a89d27d1bff7238ecb14dd0a5009c2f479b.tar.gz
glibc-74ac0a89d27d1bff7238ecb14dd0a5009c2f479b.tar.bz2
glibc-74ac0a89d27d1bff7238ecb14dd0a5009c2f479b.zip
(nscd_gethst_r): Avoid unnecesary read call if there are no aliases.
Diffstat (limited to 'nscd')
-rw-r--r--nscd/nscd_gethst_r.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c
index 70ee38b71f..9fa10e2740 100644
--- a/nscd/nscd_gethst_r.c
+++ b/nscd/nscd_gethst_r.c
@@ -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;