aboutsummaryrefslogtreecommitdiff
path: root/toys/chmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/chmod.c')
-rw-r--r--toys/chmod.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/chmod.c b/toys/chmod.c
index 2a4e5e3d..e41598c1 100644
--- a/toys/chmod.c
+++ b/toys/chmod.c
@@ -58,7 +58,7 @@ int do_chmod(struct dirtree *try)
printf("chmod '%s' to %04o\n", s, mode);
free(s);
}
- wfchmodat(try->parent ? try->parent->data : AT_FDCWD, try->name, mode);
+ wfchmodat(dirtree_parentfd(try), try->name, mode);
return (toys.optflags & FLAG_R) ? DIRTREE_RECURSE : 0;
}