fchdir: avoid infinite recursion in mingw
authorEric Blake <ebb9@byu.net>
Tue, 13 Oct 2009 15:25:30 +0000 (09:25 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 14 Oct 2009 12:25:56 +0000 (06:25 -0600)
rpl_fstat, needed only on mingw when using fchdir, should not call itself.

* lib/fchdir.c (rpl_fstat): Call system fstat, rather than
recursing.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/fchdir.c

index da30191..e19038b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-10-14  Eric Blake  <ebb9@byu.net>
 
+       fchdir: avoid infinite recursion in mingw
+       * lib/fchdir.c (rpl_fstat): Call system fstat, rather than
+       recursing.
+
        test-stat-time: port to mingw
        * tests/test-stat-time.c (force_unlink): Return a value.
        (test_ctime) [W32]: Fix compilation error.
index 19f02c3..16b17b4 100644 (file)
@@ -217,6 +217,7 @@ _gl_directory_name (int fd)
    rpl_open() used a dummy file to work around an open() that can't
    normally visit directories.  */
 #if REPLACE_OPEN_DIRECTORY
+# undef fstat
 int
 rpl_fstat (int fd, struct stat *statbuf)
 {