if (S_ISDIR(file->mode)) {
if (dry_run) return;
if (statret == 0 && !S_ISDIR(st.st_mode)) {
- if (do_unlink(fname) != 0) {
+ if (robust_unlink(fname) != 0) {
rprintf(FERROR,"unlink %s : %s\n",fname,strerror(errno));
return;
}
}
if (skip_file(fname, file, &st)) {
- set_perms(fname,file,&st,1);
+ if (fnamecmp == fname)
+ set_perms(fname,file,&st,1);
return;
}