Skip to content

Commit

Permalink
(nscd_gethst_r): Avoid unnecesary read call if there are no aliases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Nov 19, 2005
1 parent d11edae commit 74ac0a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nscd/nscd_gethst_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 74ac0a8

Please sign in to comment.