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 cbb11e5a55637e8bc89c476da3a886429fc79c73..e21684c577dde51ba7f6e72363a3fc0e7dd24bc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
index 0d2ecb05e3b17f4d4cbc5ef9d5a6f5003ca3775b..59a99a6bb638f621adde5cc46bc8376441ea4568 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))