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:
parent
35fdb1bc9c
commit
fbedacfc8c
13 changed files with 85 additions and 61 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue