Don't consider an lstat(2) failure to be an error (in the sense of

affecting the return value from bsdtar), since (a) it usually occurs
due to a perfectly innocent (and unavoidable) race condition where a
user deletes a file in the window between bsdtar reading a directory
and attempting to read the file; and (b) aside from printing a warning
message, bsdtar behaves exactly as if the file had been deleted prior
to bsdtar reading its parent directory.

Reviewed by:	kientzle
MFC after:	6 days
This commit is contained in:
Colin Percival 2007-03-15 10:11:38 +00:00
parent 851f70328e
commit 5e85b65e97

View File

@ -614,7 +614,6 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path)
if (lst == NULL) {
/* Couldn't lstat(); must not exist. */
bsdtar_warnc(bsdtar, errno, "%s: Cannot stat", name);
bsdtar->return_value = 1;
continue;
}
if (S_ISLNK(lst->st_mode))