X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flchown.c;h=59a99a6bb638f621adde5cc46bc8376441ea4568;hb=3213c107e7632d3b7e462c06acaefde7d50e5067;hp=07a912a8751058cec70b8e4d01389f8e4e363346;hpb=3030c5b5e0a5199e16b05927da72c43c42f211c3;p=gnulib.git diff --git a/lib/lchown.c b/lib/lchown.c index 07a912a87..59a99a6bb 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 Free Software + 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 @@ -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))