summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/gethostid.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/gethostid.c')
-rw-r--r--sysdeps/unix/sysv/linux/gethostid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c
index f2ebbf2b6a..6f501e391d 100644
--- a/sysdeps/unix/sysv/linux/gethostid.c
+++ b/sysdeps/unix/sysv/linux/gethostid.c
@@ -91,7 +91,8 @@ gethostid ()
/* To get the IP address we need to know the host name. */
while (__gethostbyname_r (hostname, &hostbuf, buffer, buflen, &hp, &herr)
- != 0)
+ != 0
+ || hp == NULL)
if (herr != NETDB_INTERNAL || errno != ERANGE)
return 0;
else