From: Christian Weisgerber Date: Tue, 26 Oct 2010 14:57:35 +0000 (-0600) Subject: fdopendir: fix C89 compilation X-Git-Tag: v0.1~3662 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=13d1650b8ba2db75bad3b481618220a448a34cf2;p=gnulib.git fdopendir: fix C89 compilation * lib/fdopendir.c (fd_clone_opendir): Move declaration for older compilers. --- diff --git a/ChangeLog b/ChangeLog index 95328fe7f..f18abb16e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-10-26 Christian Weisgerber (tiny change) + + fdopendir: fix C89 compilation + * lib/fdopendir.c (fd_clone_opendir): Move declaration for older + compilers. + 2010-10-23 Paul Eggert inttostr: simplify by removing unnecessary redundancy diff --git a/lib/fdopendir.c b/lib/fdopendir.c index 59826ae4a..4d2935f7a 100644 --- a/lib/fdopendir.c +++ b/lib/fdopendir.c @@ -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);