summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix/sysv/linux/gethostid.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux/gethostid.c')
-rw-r--r--libc/sysdeps/unix/sysv/linux/gethostid.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/gethostid.c b/libc/sysdeps/unix/sysv/linux/gethostid.c
index de98fb3d7..492484bcf 100644
--- a/libc/sysdeps/unix/sysv/linux/gethostid.c
+++ b/libc/sysdeps/unix/sysv/linux/gethostid.c
@@ -91,6 +91,7 @@ gethostid ()
return id;
}
+#ifdef OPTION_EGLIBC_INET
/* Getting from the file was not successful. An intelligent guess for
a unique number of a host is its IP address. Return this. */
if (__gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0')
@@ -117,5 +118,9 @@ gethostid ()
/* For the return value to be not exactly the IP address we do some
bit fiddling. */
return (int32_t) (in.s_addr << 16 | in.s_addr >> 16);
+#else
+ /* Return an arbitrary value. */
+ return 0;
+#endif
}
#endif