diff options
author | Martin Matuska <mm@FreeBSD.org> | 2023-07-24 05:42:43 +0000 |
---|---|---|
committer | Martin Matuska <mm@FreeBSD.org> | 2024-05-04 11:53:07 +0000 |
commit | cd09ca5e71a541c47752782d0b710bc95d97cbef (patch) | |
tree | 2ff5fbb504c7e48d1fc9553bfeb20f7cfcf614d2 /contrib/libarchive/libarchive/archive_write_set_format_warc.c | |
parent | d2291dbb3ccbb772fdeb9fdae88602771564e607 (diff) | |
download | src-cd09ca5e71a541c47752782d0b710bc95d97cbef.tar.gz src-cd09ca5e71a541c47752782d0b710bc95d97cbef.zip |
libarchive: merge from vendor branch
Libarchive 3.7.0
Important changes (relevant to FreeBSD):
#1814 Do not account for NULL terminator when comparing with "TRAILER!!!"
#1818 Add ability to produce multi-frame zstd archives
#1840 year 2038 fix for pax archives on platforms with 64-bit time_t
#1860 Make single bit bitfields unsigned to avoid clang 16 warning
#1869 Fix FreeBSD builds with WARNS=6
#1873 bsdunzip ported to libarchive from FreeBSD
#1894 read support for zstd compression in 7zip archives
#1918 ARM64 filter support in 7zip archives
(cherry picked from commit e64fe029e9d3ce476e77a478318e0c3cd201ff08)
Diffstat (limited to 'contrib/libarchive/libarchive/archive_write_set_format_warc.c')
-rw-r--r-- | contrib/libarchive/libarchive/archive_write_set_format_warc.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/contrib/libarchive/libarchive/archive_write_set_format_warc.c b/contrib/libarchive/libarchive/archive_write_set_format_warc.c index 46b05734121c..0ef003e2fc94 100644 --- a/contrib/libarchive/libarchive/archive_write_set_format_warc.c +++ b/contrib/libarchive/libarchive/archive_write_set_format_warc.c @@ -329,30 +329,21 @@ xstrftime(struct archive_string *as, const char *fmt, time_t t) { /** like strftime(3) but for time_t objects */ struct tm *rt; -#if defined(HAVE_GMTIME_R) || defined(HAVE__GMTIME64_S) +#if defined(HAVE_GMTIME_R) || defined(HAVE_GMTIME_S) struct tm timeHere; #endif -#if defined(HAVE__GMTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif char strtime[100]; size_t len; -#ifdef HAVE_GMTIME_R - if ((rt = gmtime_r(&t, &timeHere)) == NULL) - return; -#elif defined(HAVE__GMTIME64_S) - tmptime = t; - terr = _gmtime64_s(&timeHere, &tmptime); - if (terr) - rt = NULL; - else - rt = &timeHere; +#if defined(HAVE_GMTIME_S) + rt = gmtime_s(&timeHere, &t) ? NULL : &timeHere; +#elif defined(HAVE_GMTIME_R) + rt = gmtime_r(&t, &timeHere); #else - if ((rt = gmtime(&t)) == NULL) - return; + rt = gmtime(&t); #endif + if (!rt) + return; /* leave the hard yacker to our role model strftime() */ len = strftime(strtime, sizeof(strtime)-1, fmt, rt); archive_strncat(as, strtime, len); |