summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2005-04-17 22:49:00 +0000
committerkientzle <kientzle@FreeBSD.org>2005-04-17 22:49:00 +0000
commita46546658e6bf18d2918bf802b2daf97ef125e85 (patch)
tree17abf42248c33670f45ac1456d4ee4fd6edace45 /lib
parent4df820c33335a607198e2eb055a3f5329e4a34ce (diff)
downloadFreeBSD-src-a46546658e6bf18d2918bf802b2daf97ef125e85.zip
FreeBSD-src-a46546658e6bf18d2918bf802b2daf97ef125e85.tar.gz
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
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_read_extract.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c
index bb1327c..20fb1dd 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));
}
OpenPOWER on IntegriCloud