From 13d1650b8ba2db75bad3b481618220a448a34cf2 Mon Sep 17 00:00:00 2001 From: Christian Weisgerber Date: Tue, 26 Oct 2010 08:57:35 -0600 Subject: [PATCH] fdopendir: fix C89 compilation * lib/fdopendir.c (fd_clone_opendir): Move declaration for older compilers. --- ChangeLog | 6 ++++++ lib/fdopendir.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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); -- 2.11.0