utimens: fix compilation error
authorEric Blake <ebb9@byu.net>
Mon, 30 Nov 2009 13:45:42 +0000 (06:45 -0700)
committerEric Blake <ebb9@byu.net>
Mon, 30 Nov 2009 13:48:32 +0000 (06:48 -0700)
Fixes a regression from 2009-11-25.

* lib/utimens.c (lutimens) [!HAVE_UTIMENSAT && HAVE_LUTIMES]:
Declare variable at right scope.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/utimens.c

index 3d04361..07918de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-30  Eric Blake  <ebb9@byu.net>
+
+       utimens: fix compilation error
+       * lib/utimens.c (lutimens) [!HAVE_UTIMENSAT && HAVE_LUTIMES]:
+       Declare variable at right scope.
+
 2009-11-29  Jim Meyering  <meyering@redhat.com>
 
        bootstrap: handle perl-5.11's changed --version output
index 9e66ffc..5603600 100644 (file)
@@ -368,6 +368,7 @@ lutimens (char const *file, struct timespec const timespec[2])
   struct timespec *ts = timespec ? adjusted_timespec : NULL;
   int adjustment_needed = 0;
   struct stat st;
+  int result;
 
   if (ts)
     {
@@ -386,7 +387,7 @@ lutimens (char const *file, struct timespec const timespec[2])
 #if HAVE_UTIMENSAT
   if (0 <= lutimensat_works_really)
     {
-      int result = utimensat (AT_FDCWD, file, ts, AT_SYMLINK_NOFOLLOW);
+      result = utimensat (AT_FDCWD, file, ts, AT_SYMLINK_NOFOLLOW);
 # ifdef __linux__
       /* Work around a kernel bug:
          http://bugzilla.redhat.com/442352