X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flchown.c;h=406b9c16a89d01297601f39c00f1cff4137b2a13;hb=fb6aa6ad7dd950729f4e3349d89d4ad82761af61;hp=0d2ecb05e3b17f4d4cbc5ef9d5a6f5003ca3775b;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/lib/lchown.c b/lib/lchown.c index 0d2ecb05e..406b9c16a 100644 --- a/lib/lchown.c +++ b/lib/lchown.c @@ -1,6 +1,6 @@ /* Provide a stub lchown function for systems that lack it. - Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2010 Free Software + Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -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))