$OpenBSD: patch-gnu_fdopendir_c,v 1.1 2010/10/28 13:50:30 naddy Exp $
--- gnu/fdopendir.c.orig	Tue Oct 26 17:44:19 2010
+++ gnu/fdopendir.c	Tue Oct 26 17:45:00 2010
@@ -144,6 +144,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)
         {
@@ -152,7 +153,6 @@ fd_clone_opendir (int fd)
           goto fail;
         }
 
-      struct saved_cwd saved_cwd;
       if (save_cwd (&saved_cwd) != 0)
         openat_save_fail (errno);
 
