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 95328fe..f18abb1 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 59826ae..4d2935f 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);