64a65,70 > #define ONLY_FILES 1 > #define ONLY_DIRS 2 > > static int df_only; > > 89a96,97 > {"onlyfiles", no_argument, 0, 'F'}, > {"onlydirs", no_argument, 0, 'D'}, 167a176,196 > if (!df_only || (S_ISDIR(file_stats.st_mode) && df_only!=ONLY_FILES) > || (S_ISREG(file_stats.st_mode) && df_only!=ONLY_DIRS) ) > { > > fail = chmod (file, newmode); > > saved_errno = errno; > > > if (verbosity == V_high > || (verbosity == V_changes_only > && !fail && mode_changed (file, file_stats.st_mode))) > describe_change (file, newmode, (fail ? CH_FAILED : CH_SUCCEEDED)); > > if (fail) > { > if (force_silent == 0) > error (0, saved_errno, _("changing permissions of %s"), > quote (file)); > errors = 1; > } 169,184c198,199 < fail = chmod (file, newmode); < saved_errno = errno; < < if (verbosity == V_high < || (verbosity == V_changes_only < && !fail && mode_changed (file, file_stats.st_mode))) < describe_change (file, newmode, (fail ? CH_FAILED : CH_SUCCEEDED)); < < if (fail) < { < if (force_silent == 0) < error (0, saved_errno, _("changing permissions of %s"), < quote (file)); < errors = 1; < } < --- > } > 256a272,273 > -F, --onlyfiles change files only\n\ > -D, --onlydirs change dirs only\n\ 289c306 < recurse = force_silent = 0; --- > df_only = recurse = force_silent = 0; 295c312 < c = getopt_long (argc, argv, "RcfvrwxXstugoa,+-=", long_options, NULL); --- > c = getopt_long (argc, argv, "RDFcfvrwxXstugoa,+-=", long_options, NULL); 301a319,328 > break; > case 'D': > if (df_only) > usage(1); > df_only = ONLY_DIRS; > break; > case 'F': > if (df_only) > usage(1); > df_only = ONLY_FILES;