findutils/findutils-4.6.0-ignore_readdir_race-symlink_loop.patch
2023-08-17 00:22:23 +02:00

18 lines
640 B
Diff

# cherry picked from https://savannah.gnu.org/bugs/?45930
diff --git a/find/ftsfind.c b/find/ftsfind.c
index 0d96c4ca..6aeac28c 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -401,6 +401,10 @@ consider_visiting (FTS *p, FTSENT *ent)
}
else
{
+ /* Ignore unlink() error for vanished files. */
+ if (ENOENT == ent->fts_errno && options.ignore_readdir_race)
+ return;
+
nonfatal_target_file_error (ent->fts_errno, ent->fts_path);
/* Continue despite the error, as file name without stat info
* might be better than not even processing the file name. This