Portability enhancement: MS Windows won't restore metadata if the file

is still open, so close the file as soon as we've written the
file contents, before we attempt to restore metadata.

Thanks to:  Kees Zeelenberg
This commit is contained in:
Tim Kientzle 2005-04-17 22:49:00 +00:00
parent 6c7c20ce28
commit 48a54ddbd0

View file

@ -482,9 +482,9 @@ extract_file(struct archive *a, struct archive_entry *entry, int flags)
return (ARCHIVE_WARN);
}
r = archive_read_data_into_fd(a, fd);
close(fd);
extract->pst = NULL; /* Cached stat data no longer valid. */
r2 = restore_metadata(a, entry, flags);
close(fd);
return (err_combine(r, r2));
}