diff options
author | Rosen Penev <rosenp@gmail.com> | 2022-12-28 14:05:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-28 23:05:16 +0100 |
commit | 2e9bcba70685383426ad42c8856c50ce3214ae24 (patch) | |
tree | 7c9e8e2499110a20559cddadc20f06424c2032f9 /cpio | |
parent | 1f35c466aaa9444335a1b854b0b7223b0d2346c2 (diff) | |
download | libarchive-2e9bcba70685383426ad42c8856c50ce3214ae24.tar.gz |
further cleanup _localtime64_s (#1824)
These were missing from 2d329073435d36065ce30bfd29428f6a45e41016
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'cpio')
-rw-r--r-- | cpio/cpio.c | 11 | ||||
-rw-r--r-- | cpio/test/test_option_t.c | 11 |
2 files changed, 2 insertions, 20 deletions
diff --git a/cpio/cpio.c b/cpio/cpio.c index 7ed6a823..de0144fa 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -1156,10 +1156,6 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) #if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) struct tm tmbuf; #endif -#if defined(HAVE__LOCALTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif if (!now) time(&now); @@ -1208,12 +1204,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M"; #endif #if defined(HAVE__LOCALTIME64_S) - tmptime = mtime; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - ltime = NULL; - else - ltime = &tmbuf; + ltime = _localtime64_s(&tmbuf, &mtime) ? NULL : &tmbuf; #elif defined(HAVE_LOCALTIME_R) ltime = localtime_r(&mtime, &tmbuf); #else diff --git a/cpio/test/test_option_t.c b/cpio/test/test_option_t.c index 3d27b72d..52bcff52 100644 --- a/cpio/test/test_option_t.c +++ b/cpio/test/test_option_t.c @@ -40,10 +40,6 @@ DEFINE_TEST(test_option_t) #if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) struct tm tmbuf; #endif -#if defined(HAVE__LOCALTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif /* List reference archive, make sure the TOC is correct. */ extract_reference_file("test_option_t.cpio"); @@ -96,12 +92,7 @@ DEFINE_TEST(test_option_t) setlocale(LC_ALL, ""); #endif #if defined(HAVE__LOCALTIME64_S) - tmptime = mtime; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - tmptr = NULL; - else - tmptr = &tmbuf; + tmptr = _localtime64_s(&tmbuf, &mtime) ? NULL : &tmbuf; #elif defined(HAVE_LOCALTIME_R) tmptr = localtime_r(&mtime, &tmbuf); #else |