lchown: Avoid "unused variable" warning.
authorBruno Haible <bruno@clisp.org>
Sat, 20 Mar 2010 15:54:17 +0000 (16:54 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 20 Mar 2010 15:54:17 +0000 (16:54 +0100)
ChangeLog
lib/lchown.c

index cbb11e5..e21684c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 2010-03-20  Bruno Haible  <bruno@clisp.org>
+            Jim Meyering  <meyering@redhat.com>
+
+       lchown: Avoid "unused variable" warning.
+       * lib/lchown.c (rpl_lchown): Move variable 'st' into #if block.
+
+2010-03-20  Bruno Haible  <bruno@clisp.org>
 
        Work around unlink() bug on MacOS X 10.5.6.
        * lib/unlink.c (rpl_unlink): If UNLINK_PARENT_BUG is defined, fail when
index 0d2ecb0..59a99a6 100644 (file)
@@ -70,11 +70,12 @@ lchown (const char *file, uid_t uid, gid_t gid)
 int
 rpl_lchown (const char *file, uid_t uid, gid_t gid)
 {
-  struct stat st;
   bool stat_valid = false;
   int result;
 
 # if CHOWN_CHANGE_TIME_BUG
+  struct stat st;
+
   if (gid != (gid_t) -1 || uid != (uid_t) -1)
     {
       if (lstat (file, &st))