diff options
author | Jérémie Koenig | 2010-03-26 19:08:53 +0100 |
---|---|---|
committer | Denys Vlasenko | 2010-03-26 19:08:53 +0100 |
commit | fbedacfc8caa1ec8f14e664a881cb0a93c8f8712 (patch) | |
tree | 6c08780bbaad6320149930bdbcfbee5a2eed9f5d /libbb/safe_gethostname.c | |
parent | 35fdb1bc9cb82fa5630c2d40ae49110ecd7c88ea (diff) | |
download | busybox-fbedacfc8caa1ec8f14e664a881cb0a93c8f8712.zip busybox-fbedacfc8caa1ec8f14e664a881cb0a93c8f8712.tar.gz |
Hurd compat fixes. Mostly dealing with absent PATH_MAX
Signed-off-by: Jérémie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/safe_gethostname.c')
-rw-r--r-- | libbb/safe_gethostname.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libbb/safe_gethostname.c b/libbb/safe_gethostname.c index 7407fb7..e93254b 100644 --- a/libbb/safe_gethostname.c +++ b/libbb/safe_gethostname.c @@ -59,8 +59,12 @@ char* FAST_FUNC safe_gethostname(void) */ char* FAST_FUNC safe_getdomainname(void) { +/* The field domainname of struct utsname is Linux specific. */ +#if defined(__linux__) struct utsname uts; - uname(&uts); return xstrndup(!uts.domainname[0] ? "?" : uts.domainname, sizeof(uts.domainname)); +#else + return xstrdup("?"); +#endif } |