X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=coreutils%2Fchmod.c;h=f07a49bd3b0922efae9865d98fa875aefcb8123e;hb=982aa263a0cef10ee4f4c06084a87af736c449ac;hp=dd7b78412c164da62cef3b5e7c0e36900bc78c64;hpb=0c97c9d43707da745fe2bc62ab2a69497ceaf666;p=oweals%2Fbusybox.git diff --git a/coreutils/chmod.c b/coreutils/chmod.c index dd7b78412..f07a49bd3 100644 --- a/coreutils/chmod.c +++ b/coreutils/chmod.c @@ -7,7 +7,7 @@ * Reworked by (C) 2002 Vladimir Oleynik * to correctly parse '-rwxgoa' * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ /* BB_AUDIT SUSv3 compliant */ @@ -20,10 +20,10 @@ #define OPT_RECURSE (option_mask32 & 1) -#define OPT_VERBOSE (USE_DESKTOP(option_mask32 & 2) SKIP_DESKTOP(0)) -#define OPT_CHANGED (USE_DESKTOP(option_mask32 & 4) SKIP_DESKTOP(0)) -#define OPT_QUIET (USE_DESKTOP(option_mask32 & 8) SKIP_DESKTOP(0)) -#define OPT_STR "R" USE_DESKTOP("vcf") +#define OPT_VERBOSE (IF_DESKTOP(option_mask32 & 2) IF_NOT_DESKTOP(0)) +#define OPT_CHANGED (IF_DESKTOP(option_mask32 & 4) IF_NOT_DESKTOP(0)) +#define OPT_QUIET (IF_DESKTOP(option_mask32 & 8) IF_NOT_DESKTOP(0)) +#define OPT_STR "R" IF_DESKTOP("vcf") /* coreutils: * chmod never changes the permissions of symbolic links; the chmod @@ -34,7 +34,7 @@ * symbolic links encountered during recursive directory traversals. */ -static int fileAction(const char *fileName, struct stat *statbuf, void* param, int depth) +static int FAST_FUNC fileAction(const char *fileName, struct stat *statbuf, void* param, int depth) { mode_t newmode; @@ -50,7 +50,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* param, i newmode = statbuf->st_mode; if (!bb_parse_mode((char *)param, &newmode)) - bb_error_msg_and_die("invalid mode: %s", (char *)param); + bb_error_msg_and_die("invalid mode '%s'", (char *)param); if (chmod(fileName, newmode) == 0) { if (OPT_VERBOSE @@ -67,8 +67,8 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* param, i return FALSE; } -int chmod_main(int argc, char **argv); -int chmod_main(int argc, char **argv) +int chmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; +int chmod_main(int argc UNUSED_PARAM, char **argv) { int retval = EXIT_SUCCESS; char *arg, **argp;