summaryrefslogtreecommitdiff
path: root/src/chown-core.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-10-13 18:51:08 +0000
committerJim Meyering <jim@meyering.net>2006-10-13 18:51:08 +0000
commitdc9790379c129698d0dead906135a4a7b0b551f6 (patch)
treecf62bdc10d300080d825f1d711a86c2f6d8c70f0 /src/chown-core.c
parent8552234cb58fa8bb17a3ee53ee4bfafd5d2e1ec1 (diff)
downloadcoreutils-dc9790379c129698d0dead906135a4a7b0b551f6.tar.xz
* src/chown-core.c (change_file_owner): Use fstatat, not stat,
now that we're using fts_open with FTS_CWDFD. * tests/chgrp/posix-H: Add --preserve-root to an invocation of chgrp, to exercise the above fix.
Diffstat (limited to 'src/chown-core.c')
-rw-r--r--src/chown-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/chown-core.c b/src/chown-core.c
index dbd3e52d8..d1efe52b6 100644
--- a/src/chown-core.c
+++ b/src/chown-core.c
@@ -318,7 +318,7 @@ change_file_owner (FTS *fts, FTSENT *ent,
stat it to get info on the referent. */
if (S_ISLNK (file_stats->st_mode) && chopt->affect_symlink_referent)
{
- if (stat (file, &stat_buf) != 0)
+ if (fstatat (fts->fts_cwd_fd, file, &stat_buf, 0) != 0)
{
error (0, errno, _("cannot dereference %s"),
quote (file_full_name));