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>
This commit is contained in:
committed by
Denys Vlasenko
parent
35fdb1bc9c
commit
fbedacfc8c
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user