# HG changeset patch # User Rob Landley # Date 1339375473 18000 # Node ID 051dffe00b9941c7bdd23496b5c28ca04eadc26e # Parent fb582378a36afc179722efd8ac5d5e02b09ef9e8 The linux from scratch build wants -v on chmod. diff -r fb582378a36a -r 051dffe00b99 toys/chmod.c --- a/toys/chmod.c Sat Jun 09 22:25:49 2012 -0500 +++ b/toys/chmod.c Sun Jun 10 19:44:33 2012 -0500 @@ -7,7 +7,7 @@ * See http://pubs.opengroup.org/onlinepubs/009695399/utilities/chmod.html * -USE_CHMOD(NEWTOY(chmod, "<2?R", TOYFLAG_BIN)) +USE_CHMOD(NEWTOY(chmod, "<2?vR", TOYFLAG_BIN)) config CHMOD bool "chmod" @@ -44,6 +44,7 @@ #define TT this.chmod #define FLAG_R 1 +#define FLAG_v 2 int do_chmod(struct dirtree *try) { @@ -52,6 +53,11 @@ if (!dirtree_notdotdot(try)) return 0; mode = string_to_mode(TT.mode, try->st.st_mode); + if (toys.optflags & FLAG_v) { + char *s = dirtree_path(try, 0); + printf("chmod '%s' to %04o\n", s, mode); + free(s); + } wfchmodat(try->parent ? try->parent->data : AT_FDCWD, try->name, mode); return (toys.optflags & FLAG_R) ? DIRTREE_RECURSE : 0;