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:
Jérémie Koenig
2010-03-26 19:08:53 +01:00
committed by Denys Vlasenko
parent 35fdb1bc9c
commit fbedacfc8c
13 changed files with 85 additions and 61 deletions

View File

@ -100,18 +100,16 @@ char* FAST_FUNC xmalloc_readlink_or_warn(const char *path)
return buf;
}
/* UNUSED */
#if 0
char* FAST_FUNC xmalloc_realpath(const char *path)
{
#if defined(__GLIBC__) && !defined(__UCLIBC__)
/* glibc provides a non-standard extension */
/* new: POSIX.1-2008 specifies this behavior as well */
return realpath(path, NULL);
#else
char buf[PATH_MAX+1];
/* on error returns NULL (xstrdup(NULL) ==NULL) */
/* on error returns NULL (xstrdup(NULL) == NULL) */
return xstrdup(realpath(path, buf));
#endif
}
#endif