fdopendir: fix C89 compilation
authorChristian Weisgerber <naddy@mips.inka.de>
Tue, 26 Oct 2010 14:57:35 +0000 (08:57 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 26 Oct 2010 14:57:35 +0000 (08:57 -0600)
* lib/fdopendir.c (fd_clone_opendir): Move declaration for older
compilers.

ChangeLog
lib/fdopendir.c

index 95328fe7fc1b0382d9bea2cc3ed83294cd546d32..f18abb16ea29d891c33e962c4fbc724103759636 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-26  Christian Weisgerber  <naddy@mips.inka.de>  (tiny change)
+
+       fdopendir: fix C89 compilation
+       * lib/fdopendir.c (fd_clone_opendir): Move declaration for older
+       compilers.
+
 2010-10-23  Paul Eggert  <eggert@cs.ucla.edu>
 
        inttostr: simplify by removing unnecessary redundancy
index 59826ae4aa1c28b83b5850c68284521e8a357b10..4d2935f7a37be55e41ae83eaee8951bac1c5ee4a 100644 (file)
@@ -142,6 +142,7 @@ fd_clone_opendir (int fd)
 # else /* !REPLACE_FCHDIR */
 
       /* Occupy the destination FD slot, so that save_cwd cannot hijack it.  */
+      struct saved_cwd saved_cwd;
       int fd_reserve = dup (fd);
       if (fd_reserve < 0)
         {
@@ -150,7 +151,6 @@ fd_clone_opendir (int fd)
           goto fail;
         }
 
-      struct saved_cwd saved_cwd;
       if (save_cwd (&saved_cwd) != 0)
         openat_save_fail (errno);