diff options
author | kientzle <kientzle@FreeBSD.org> | 2007-12-30 04:58:22 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2007-12-30 04:58:22 +0000 |
commit | 2b8395148ff378e52a5e00c0d2ac0123258b759b (patch) | |
tree | 743c28601a2502c30676ab2adfbbb665fa3f38b7 /lib/libarchive/archive_entry.c | |
parent | b1a3a611be764b44dbdd47a17ec5076bcfbe6e88 (diff) | |
download | FreeBSD-src-2b8395148ff378e52a5e00c0d2ac0123258b759b.zip FreeBSD-src-2b8395148ff378e52a5e00c0d2ac0123258b759b.tar.gz |
Update libarchive to 2.4.10. This includes a number of improvements
that I've been working on but put off committing until after the
RELENG_7 branch, including:
* New manpages: cpio.5 mtree.5
* New archive_entry_strmode()
* New archive_entry_link_resolver()
* New read support: mtree format
* Internal API change: read format auction only runs once
* Running the auction only once allowed simplifying a lot of bid logic.
* Cpio robustness: search for next header after a sync error
* Support device nodes on ISO9660 images
* Eliminate a lot of unnecessary copies for uncompressed archives
* Corrected handling of new GNU --sparse --posix formats
* Correctly handle a zero-byte write to a compressed archive
* Fixed memory leaks
Many of these improvements were motivated by the upcoming bsdcpio
front-end.
There have also been extensive improvements to the libarchive_test
test harness, which I'll commit separately.
Diffstat (limited to 'lib/libarchive/archive_entry.c')
-rw-r--r-- | lib/libarchive/archive_entry.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index 3f6984d..34c9116 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$"); #endif #ifdef MAJOR_IN_MKDEV #include <sys/mkdev.h> -# if !defined makedev && (defined mkdev || defined _WIN32 || defined __WIN32__) -# define makedev mkdev -# endif #else #ifdef MAJOR_IN_SYSMACROS #include <sys/sysmacros.h> @@ -74,6 +71,22 @@ __FBSDID("$FreeBSD$"); #undef max #define max(a, b) ((a)>(b)?(a):(b)) +/* Play games to come up with a suitable makedev() definition. */ +#ifdef __QNXNTO__ +/* QNX. <sigh> */ +#include <sys/netmgr.h> +#define ae_makedev(maj, min) makedev(ND_LOCAL_NODE, (maj), (min)) +#elif defined makedev +/* There's a "makedev" macro. */ +#define ae_makedev(maj, min) makedev((maj), (min)) +#elif defined mkdev || defined _WIN32 || defined __WIN32__ +/* Windows. <sigh> */ +#define ae_makedev(maj, min) mkdev((maj), (min)) +#else +/* There's a "makedev" function. */ +#define ae_makedev(maj, min) makedev((maj), (min)) +#endif + static void aes_clean(struct aes *); static void aes_copy(struct aes *dest, struct aes *src); static const char * aes_get_mbs(struct aes *); @@ -402,7 +415,7 @@ dev_t archive_entry_dev(struct archive_entry *entry) { if (entry->ae_stat.aest_dev_is_broken_down) - return makedev(entry->ae_stat.aest_devmajor, + return ae_makedev(entry->ae_stat.aest_devmajor, entry->ae_stat.aest_devminor); else return (entry->ae_stat.aest_dev); @@ -548,7 +561,7 @@ dev_t archive_entry_rdev(struct archive_entry *entry) { if (entry->ae_stat.aest_rdev_is_broken_down) - return makedev(entry->ae_stat.aest_rdevmajor, + return ae_makedev(entry->ae_stat.aest_rdevmajor, entry->ae_stat.aest_rdevminor); else return (entry->ae_stat.aest_rdev); @@ -780,6 +793,14 @@ archive_entry_copy_pathname_w(struct archive_entry *entry, const wchar_t *name) } void +archive_entry_set_perm(struct archive_entry *entry, mode_t p) +{ + entry->stat_valid = 0; + entry->ae_stat.aest_mode &= AE_IFMT; + entry->ae_stat.aest_mode |= ~AE_IFMT & p; +} + +void archive_entry_set_rdev(struct archive_entry *entry, dev_t m) { entry->stat_valid = 0; |