From b0ed57b1aad9d2a0cfb64999cc1e0bc15471a48c Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 1 May 2020 18:00:23 -0500 Subject: Minor cleanup. --- toys/posix/chmod.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'toys/posix') 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) -- cgit v1.2.3