X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffstatat.c;h=9b701c4d6175e2bcfe3797bf710490a74fb423a0;hb=88236bad53d1dd5e6b8a592a724736bbd9db7851;hp=4b01d6660c22b2c323302a4274a8291036d1ce7e;hpb=6563cd7648f78ce137eb66d4a9a77f9f1666d17f;p=gnulib.git diff --git a/lib/fstatat.c b/lib/fstatat.c index 4b01d6660..9b701c4d6 100644 --- a/lib/fstatat.c +++ b/lib/fstatat.c @@ -1,6 +1,6 @@ /* Work around an fstatat bug on Solaris 9. - Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2012 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 @@ -45,7 +45,7 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags) #include #include -#if HAVE_FSTATAT && !FSTATAT_ZERO_FLAG_BROKEN +#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG # ifndef LSTAT_FOLLOWS_SLASHED_SYMLINK # define LSTAT_FOLLOWS_SLASHED_SYMLINK 0 @@ -90,9 +90,9 @@ rpl_fstatat (int fd, char const *file, struct stat *st, int flag) return result; } -#else /* !HAVE_FSTATAT || FSTATAT_ZERO_FLAG_BROKEN */ +#else /* ! (HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG) */ -/* On mingw, the gnulib defines `stat' as a function-like +/* On mingw, the gnulib defines 'stat' as a function-like macro; but using it in AT_FUNC_F2 causes compilation failure because the preprocessor sees a use of a macro that requires two arguments but is only given one. Hence, we need an inline @@ -103,7 +103,7 @@ stat_func (char const *name, struct stat *st) return stat (name, st); } -/* Likewise, if there is no native `lstat', then the gnulib +/* Likewise, if there is no native 'lstat', then the gnulib defined it as stat, which also needs adjustment. */ # if !HAVE_LSTAT # undef lstat @@ -118,11 +118,7 @@ stat_func (char const *name, struct stat *st) then give a diagnostic and exit nonzero. Otherwise, this function works just like Solaris' fstatat. */ -# if FSTATAT_ZERO_FLAG_BROKEN -# define AT_FUNC_NAME rpl_fstatat -# else -# define AT_FUNC_NAME fstatat -# endif +# define AT_FUNC_NAME fstatat # define AT_FUNC_F1 lstat # define AT_FUNC_F2 stat_func # define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW