[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning in lchown.c
From: |
Eric Blake |
Subject: |
Re: warning in lchown.c |
Date: |
Sat, 20 Mar 2010 10:01:22 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3 |
On 03/20/2010 08:05 AM, Bruno Haible wrote:
> Hi Jim or Eric,
>
> On MacOS X, with "gcc -Wall", I'm seeing this warning:
>
> gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -MT lchown.o -MD -MP -MF
> .deps/lchown.Tpo -c -o lchown.o lchown.c
> lchown.c: In function 'rpl_lchown':
> lchown.c:73: warning: unused variable 'st'
>
> Is it ok to apply this as a fix?
Seems okay to me, although this is a smaller diff with the same results:
diff --git i/lib/lchown.c w/lib/lchown.c
index 0d2ecb0..a538087 100644
--- i/lib/lchown.c
+++ w/lib/lchown.c
@@ -70,11 +70,11 @@ 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))
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature