aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-05-01 18:00:23 -0500
committerRob Landley <rob@landley.net>2020-05-01 18:00:23 -0500
commitb0ed57b1aad9d2a0cfb64999cc1e0bc15471a48c (patch)
tree911a5a91ad7d20cb9691fd290caa8e8f44a9d90d /toys
parent954f4e2ab3d28b1bc6021bce7cf5c919f54d5e18 (diff)
downloadtoybox-b0ed57b1aad9d2a0cfb64999cc1e0bc15471a48c.tar.gz
Minor cleanup.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/chmod.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/toys/posix/chmod.c b/toys/posix/chmod.c
index 42924399..ac53957c 100644
--- a/toys/posix/chmod.c
+++ b/toys/posix/chmod.c
@@ -4,7 +4,7 @@
*
* See http://opengroup.org/onlinepubs/9699919799/utilities/chmod.html
-USE_CHMOD(NEWTOY(chmod, "<2?vRf[-vf]", TOYFLAG_BIN))
+USE_CHMOD(NEWTOY(chmod, "<2?vfR[-vf]", TOYFLAG_BIN))
config CHMOD
bool "chmod"
@@ -46,14 +46,15 @@ static int do_chmod(struct dirtree *try)
if (!dirtree_notdotdot(try)) return 0;
mode = string_to_mode(TT.mode, try->st.st_mode);
- if (toys.optflags & FLAG_v) {
+ if (FLAG(v)) {
char *s = dirtree_path(try, 0);
- printf("chmod '%s' to %04o\n", s, mode);
+
+ printf("chmod '%s' to %s\n", s, TT.mode);
free(s);
}
wfchmodat(dirtree_parentfd(try), try->name, mode);
- return (toys.optflags & FLAG_R) ? DIRTREE_RECURSE : 0;
+ return FLAG(R)*DIRTREE_RECURSE;
}
void chmod_main(void)