X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flchown.c;h=59a99a6bb638f621adde5cc46bc8376441ea4568;hb=6d62642d28119a6eed354809c7686bdd3b20e243;hp=19eb9c6c57ef4d6fb30464b997cd0bec4774d058;hpb=84405cbc35207f178b1b50617254cb85ea803128;p=gnulib.git diff --git a/lib/lchown.c b/lib/lchown.c index 19eb9c6c5..59a99a6bb 100644 --- a/lib/lchown.c +++ b/lib/lchown.c @@ -1,7 +1,7 @@ /* Provide a stub lchown function for systems that lack it. - Copyright (C) 1998, 1999, 2002, 2004, 2006, 2007, 2009 Free - Software Foundation, Inc. + Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2010 Free Software + Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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))