From 3e852ad6c27ac44b3e76bb2ee2a4e18c96f524b4 Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Sat, 5 May 2007 21:25:33 +0000 Subject: [PATCH] Import libarchive 2.1.10 which brings in a few minor code cleanups. --- contrib/libarchive-2.1/NEWS | 3 ++ .../libarchive-2.1/libarchive/archive_entry.c | 54 +++++++++++++++---- .../libarchive/archive_platform.h | 29 ---------- .../libarchive-2.1/libarchive/archive_util.3 | 12 ++--- .../archive_write_disk_set_standard_lookup.c | 3 ++ contrib/libarchive-2.1/version | 2 +- 6 files changed, 58 insertions(+), 45 deletions(-) diff --git a/contrib/libarchive-2.1/NEWS b/contrib/libarchive-2.1/NEWS index 73f81b0119..5244219f73 100644 --- a/contrib/libarchive-2.1/NEWS +++ b/contrib/libarchive-2.1/NEWS @@ -1,4 +1,7 @@ +Apr 30, 2007: libarchive 2.1.10 released +Apr 31, 2007: Minor code cleanup. + Apr 24, 2007: libarchive 2.1.9 released Apr 24, 2007: Fix some recently-introduced problems with libraries (Just let automake handle it and it all works much better.) diff --git a/contrib/libarchive-2.1/libarchive/archive_entry.c b/contrib/libarchive-2.1/libarchive/archive_entry.c index bd6c85cb02..c96b549b6d 100644 --- a/contrib/libarchive-2.1/libarchive/archive_entry.c +++ b/contrib/libarchive-2.1/libarchive/archive_entry.c @@ -444,8 +444,14 @@ archive_entry_atime(struct archive_entry *entry) long archive_entry_atime_nsec(struct archive_entry *entry) { - (void)entry; /* entry can be unused here. */ - return (ARCHIVE_STAT_ATIME_NANOS(&entry->ae_stat)); +#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC + return (entry->ae_stat.st_atimespec.tv_nsec); +#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + return (entry->ae_stat.st_atim.tv_nsec); +#else + (void)entry; /* UNUSED */ + return (0); +#endif } time_t @@ -457,8 +463,14 @@ archive_entry_ctime(struct archive_entry *entry) long archive_entry_ctime_nsec(struct archive_entry *entry) { - (void)entry; /* entry can be unused here. */ - return (ARCHIVE_STAT_CTIME_NANOS(&entry->ae_stat)); +#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC + return (entry->ae_stat.st_ctimespec.tv_nsec); +#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + return (entry->ae_stat.st_ctim.tv_nsec); +#else + (void)entry; /* UNUSED */ + return (0); +#endif } dev_t @@ -564,8 +576,14 @@ archive_entry_mtime(struct archive_entry *entry) long archive_entry_mtime_nsec(struct archive_entry *entry) { - (void)entry; /* entry can be unused here. */ - return (ARCHIVE_STAT_MTIME_NANOS(&entry->ae_stat)); +#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC + return (entry->ae_stat.st_mtimespec.tv_nsec); +#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + return (entry->ae_stat.st_mtim.tv_nsec); +#else + (void)entry; /* UNUSED */ + return (0); +#endif } unsigned int @@ -731,14 +749,26 @@ void archive_entry_set_atime(struct archive_entry *entry, time_t t, long ns) { entry->ae_stat.st_atime = t; - ARCHIVE_STAT_SET_ATIME_NANOS(&entry->ae_stat, ns); +#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC + entry->ae_stat.st_atimespec.tv_nsec = ns; +#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + entry->ae_stat.st_atim.tv_nsec = ns; +#else + (void)ns; /* UNUSED */ +#endif } void archive_entry_set_ctime(struct archive_entry *entry, time_t t, long ns) { entry->ae_stat.st_ctime = t; - ARCHIVE_STAT_SET_CTIME_NANOS(&entry->ae_stat, ns); +#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC + entry->ae_stat.st_ctimespec.tv_nsec = ns; +#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + entry->ae_stat.st_ctim.tv_nsec = ns; +#else + (void)ns; /* UNUSED */ +#endif } void @@ -786,7 +816,13 @@ void archive_entry_set_mtime(struct archive_entry *entry, time_t m, long ns) { entry->ae_stat.st_mtime = m; - ARCHIVE_STAT_SET_MTIME_NANOS(&entry->ae_stat, ns); +#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC + entry->ae_stat.st_mtimespec.tv_nsec = ns; +#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + entry->ae_stat.st_mtim.tv_nsec = ns; +#else + (void)ns; /* UNUSED */ +#endif } void diff --git a/contrib/libarchive-2.1/libarchive/archive_platform.h b/contrib/libarchive-2.1/libarchive/archive_platform.h index 592ff6f97f..b6815f5179 100644 --- a/contrib/libarchive-2.1/libarchive/archive_platform.h +++ b/contrib/libarchive-2.1/libarchive/archive_platform.h @@ -122,33 +122,4 @@ #define ARCHIVE_ERRNO_MISC (-1) #endif -/* Select the best way to set/get hi-res timestamps. */ -#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC -/* FreeBSD uses "timespec" members. */ -#define ARCHIVE_STAT_ATIME_NANOS(st) (st)->st_atimespec.tv_nsec -#define ARCHIVE_STAT_CTIME_NANOS(st) (st)->st_ctimespec.tv_nsec -#define ARCHIVE_STAT_MTIME_NANOS(st) (st)->st_mtimespec.tv_nsec -#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n) (st)->st_atimespec.tv_nsec = (n) -#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n) (st)->st_ctimespec.tv_nsec = (n) -#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n) (st)->st_mtimespec.tv_nsec = (n) -#else -#if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC -/* Linux uses "tim" members. */ -#define ARCHIVE_STAT_ATIME_NANOS(pstat) (pstat)->st_atim.tv_nsec -#define ARCHIVE_STAT_CTIME_NANOS(pstat) (pstat)->st_ctim.tv_nsec -#define ARCHIVE_STAT_MTIME_NANOS(pstat) (pstat)->st_mtim.tv_nsec -#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n) (st)->st_atim.tv_nsec = (n) -#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n) (st)->st_ctim.tv_nsec = (n) -#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n) (st)->st_mtim.tv_nsec = (n) -#else -/* If we can't find a better way, just use stubs. */ -#define ARCHIVE_STAT_ATIME_NANOS(pstat) 0 -#define ARCHIVE_STAT_CTIME_NANOS(pstat) 0 -#define ARCHIVE_STAT_MTIME_NANOS(pstat) 0 -#define ARCHIVE_STAT_SET_ATIME_NANOS(st, n) ((void)(n)) -#define ARCHIVE_STAT_SET_CTIME_NANOS(st, n) ((void)(n)) -#define ARCHIVE_STAT_SET_MTIME_NANOS(st, n) ((void)(n)) -#endif -#endif - #endif /* !ARCHIVE_H_INCLUDED */ diff --git a/contrib/libarchive-2.1/libarchive/archive_util.3 b/contrib/libarchive-2.1/libarchive/archive_util.3 index 4fc2a4871e..1d8a356425 100644 --- a/contrib/libarchive-2.1/libarchive/archive_util.3 +++ b/contrib/libarchive-2.1/libarchive/archive_util.3 @@ -31,12 +31,12 @@ .Nm archive_clear_error , .Nm archive_compression , .Nm archive_compression_name , +.Nm archive_copy_error , .Nm archive_errno , .Nm archive_error_string , .Nm archive_format , .Nm archive_format_name , -.Nm archive_set_error , -.Nm archive_copy_error +.Nm archive_set_error .Nd libarchive utility functions .Sh SYNOPSIS .In archive.h @@ -46,6 +46,8 @@ .Fn archive_compression "struct archive *" .Ft const char * .Fn archive_compression_name "struct archive *" +.Ft void +.Fn archive_copy_error "struct archive *" "struct archive *" .Ft int .Fn archive_errno "struct archive *" .Ft const char * @@ -56,8 +58,6 @@ .Fn archive_format_name "struct archive *" .Ft void .Fn archive_set_error "struct archive *" "int error_code" "const char *fmt" "..." -.Ft void -.Fn archive_copy_error "struct archive *" "struct archive *" .Sh DESCRIPTION These functions provide access to various information about the .Tn struct archive @@ -74,6 +74,8 @@ This value is set by .Fn archive_read_open . .It Fn archive_compression_name Returns a text description of the current compression suitable for display. +.It Fn archive_copy_error +Copies error information from one archive to another. .It Fn archive_errno Returns a numeric error code (see .Xr errno 2 ) @@ -125,8 +127,6 @@ format specifiers: .Dq %% . Field-width specifiers and other printf features are not uniformly supported and should not be used. -.It Fn archive_copy_error -Copies error information from one archive to another. .El .Sh SEE ALSO .Xr archive_read 3 , diff --git a/contrib/libarchive-2.1/libarchive/archive_write_disk_set_standard_lookup.c b/contrib/libarchive-2.1/libarchive/archive_write_disk_set_standard_lookup.c index 054b942f27..a750545a86 100644 --- a/contrib/libarchive-2.1/libarchive/archive_write_disk_set_standard_lookup.c +++ b/contrib/libarchive-2.1/libarchive/archive_write_disk_set_standard_lookup.c @@ -26,6 +26,9 @@ #include "archive_platform.h" __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk_set_standard_lookup.c,v 1.2 2007/04/20 15:32:13 kientzle Exp $"); +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef HAVE_ERRNO_H #include #endif diff --git a/contrib/libarchive-2.1/version b/contrib/libarchive-2.1/version index b88e5006fb..41bb57bd66 100644 --- a/contrib/libarchive-2.1/version +++ b/contrib/libarchive-2.1/version @@ -1 +1 @@ -2.1.9 \ No newline at end of file +2.1.10 \ No newline at end of file -- 2.41.0