With -delete, don't complain about non-empty directories. Otherwise

"cd /tmp; find . -mtime +7 -delete" is excessively noisy.
This commit is contained in:
Peter Wemm 1996-10-05 23:47:07 +00:00
parent ad8b2071ac
commit 3598e52ce6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18720

View File

@ -972,7 +972,7 @@ f_delete(plan, entry)
/* rmdir directories, unlink everything else */
if (S_ISDIR(entry->fts_statp->st_mode)) {
if (rmdir(entry->fts_accpath) < 0)
if (rmdir(entry->fts_accpath) < 0 && errno != ENOTEMPTY)
warn("-delete: rmdir(%s)", entry->fts_path);
} else {
if (unlink(entry->fts_accpath) < 0)