|
@@ -446,11 +446,12 @@ int bb_recursive(const char *fpath, const struct stat *sb,
|
|
}
|
|
}
|
|
|
|
|
|
/* chmod() is optional, also skip if dangling symlink */
|
|
/* chmod() is optional, also skip if dangling symlink */
|
|
- if (recursive_mode != -1 && tflag == FTW_SL && access(fpath, F_OK)) {
|
|
|
|
- if (chmod(fpath, recursive_mode) < 0) {
|
|
|
|
- bb_perror_msg("chmod failed for %s", fpath);
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
|
|
+ if (recursive_mode == -1 || (tflag == FTW_SL && !access(fpath, F_OK)))
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ if (chmod(fpath, recursive_mode) < 0) {
|
|
|
|
+ bb_perror_msg("chmod failed for %s", fpath);
|
|
|
|
+ return -1;
|
|
}
|
|
}
|
|
|
|
|
|
return 0;
|
|
return 0;
|