From 48a54ddbd03bb9568bb4f26f00090ec7abfe67ba Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 17 Apr 2005 22:49:00 +0000 Subject: [PATCH] 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 --- lib/libarchive/archive_read_extract.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c index bb1327c884e..20fb1dd7518 100644 --- a/lib/libarchive/archive_read_extract.c +++ b/lib/libarchive/archive_read_extract.c @@ -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)); }