/* Work around an fstatat bug on Solaris 9.
- Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <fcntl.h>
#include <string.h>
-#if HAVE_FSTATAT
+#if HAVE_FSTATAT && ! FSTATAT_ST_SIZE_ETC_BROKEN
# undef fstatat
{
/* Fix lstat behavior. */
if (file[len - 1] != '/' || S_ISDIR (st->st_mode))
- return 0;
+ return 0;
if (!S_ISLNK (st->st_mode))
- {
- errno = ENOTDIR;
- return -1;
- }
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
result = fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
}
/* Fix stat behavior. */
return result;
}
-#else /* !HAVE_FSTATAT */
+#else /* ! (HAVE_FSTATAT && ! FSTATAT_ST_SIZE_ETC_BROKEN) */
+
+# if HAVE_FSTATAT
+# undef fstatat
+# define fstatat rpl_fstatat
+# endif
/* On mingw, the gnulib <sys/stat.h> defines `stat' as a function-like
macro; but using it in AT_FUNC_F2 causes compilation failure
# undef AT_FUNC_POST_FILE_PARAM_DECLS
# undef AT_FUNC_POST_FILE_ARGS
-#endif /* !HAVE_FSTATAT */
+#endif /* ! (HAVE_FSTATAT && ! FSTATAT_ST_SIZE_ETC_BROKEN) */