Thanks for the further details about the problem.

On 11/18/11 14:54, Mats Erik Andersson wrote:
> # if ! HAVE_WORKING_FSTATAT_ZERO_FLAG
> #  define AT_FUNC_NAME rpl_fstatat
> # else
> #  define AT_FUNC_NAME fstatat
> # endif
> 
> ... This is probably broken.

Right you are.  The macro should depend on HAVE_FSTATAT,
not on HAVE_WORKING_FSTATAT_ZERO_FLAG.

> Conclusion: The computation of REPLACE_FSTATAT is broken.

Hmm, no, I think that part is OK.  REPLACE_FSTATAT does not mean
"please supply a fstatat implementation from gnulib's".  It means "please
replace the system's fstatat implementation with gnulib's", which is
less common.

Anyway, I've verified that the following patch fixes the bug on
Solaris 8, so I've pushed it into gnulib.

Can you please try it for OpenBSD 4?  Thanks.  I'll also
CC: this to Kai Habel, as I think it'll fix his problem too.

----

fstatat: fix configuration bug on mingw, OpenBSD 4, Solaris 8
* lib/fstatat.c (AT_FUNC_NAME): Use HAVE_FSTAT, not
HAVE_WORKING_FSTATAT_ZERO_FLAG, to decide whether to define
rpl_fstatat or fstatat.  This should fix the other problem
reported by Kai Habel in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00237.html>.
A similar problem was reported for OpenBSD 4.6 by Mats Erik Andersson
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00239.html>
and I reproduced it on a Solaris 8 host we still have in production.
diff --git a/lib/fstatat.c b/lib/fstatat.c
index e7b0a09..b53a83d 100644
--- a/lib/fstatat.c
+++ b/lib/fstatat.c
@@ -118,7 +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 ! HAVE_WORKING_FSTATAT_ZERO_FLAG
+# if HAVE_FSTATAT
 #  define AT_FUNC_NAME rpl_fstatat
 # else
 #  define AT_FUNC_NAME fstatat


Reply via email to