* Reworked by (C) 2002 Vladimir Oleynik <dzo@simtreas.ru>
* 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 */
#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
* 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;
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
}
err:
if (!OPT_QUIET)
- bb_perror_msg("%s", fileName);
+ bb_simple_perror_msg(fileName);
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;