summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-02-19 05:54:24 +0000
committerkientzle <kientzle@FreeBSD.org>2008-02-19 05:54:24 +0000
commit5b631adaa6d1d6d0a681e5520c8bb66d2eafb7f6 (patch)
treeed50f1aa98758b4259c683451eff8b5810f57ad7 /lib
parentc300e636ead4e5c1bd3c3583d2c8dc675c72c408 (diff)
downloadFreeBSD-src-5b631adaa6d1d6d0a681e5520c8bb66d2eafb7f6.zip
FreeBSD-src-5b631adaa6d1d6d0a681e5520c8bb66d2eafb7f6.tar.gz
Simplify file type setting.
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_read_support_format_ar.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libarchive/archive_read_support_format_ar.c b/lib/libarchive/archive_read_support_format_ar.c
index 0094a34..5ce14b9 100644
--- a/lib/libarchive/archive_read_support_format_ar.c
+++ b/lib/libarchive/archive_read_support_format_ar.c
@@ -268,8 +268,7 @@ archive_read_format_ar_read_header(struct archive_read *a,
/* This must come before any call to _read_ahead. */
ar_parse_common_header(ar, entry, h);
archive_entry_copy_pathname(entry, filename);
- archive_entry_set_mode(entry,
- S_IFREG | (archive_entry_mode(entry) & 0777));
+ archive_entry_set_filetype(entry, AE_IFREG);
/* Get the size of the filename table. */
number = ar_atol10(h + AR_size_offset, AR_size_size);
if (number > SIZE_MAX) {
@@ -375,8 +374,7 @@ archive_read_format_ar_read_header(struct archive_read *a,
/* Parse the time, owner, mode, size fields. */
r = ar_parse_common_header(ar, entry, h);
/* Force the file type to a regular file. */
- archive_entry_set_mode(entry,
- S_IFREG | (archive_entry_mode(entry) & 0777));
+ archive_entry_set_filetype(entry, AE_IFREG);
return (r);
}
OpenPOWER on IntegriCloud