aboutsummaryrefslogtreecommitdiff
path: root/contrib/libarchive/tar/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libarchive/tar/util.c')
-rw-r--r--contrib/libarchive/tar/util.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/contrib/libarchive/tar/util.c b/contrib/libarchive/tar/util.c
index 231c53e2cf6b..37f0d54f4b08 100644
--- a/contrib/libarchive/tar/util.c
+++ b/contrib/libarchive/tar/util.c
@@ -668,13 +668,9 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
time_t tim;
static time_t now;
struct tm *ltime;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
/*
* We avoid collecting the entire list in memory at once by
@@ -746,15 +742,10 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
fmt = bsdtar->day_first ? DAY_FMT " %b %Y" : "%b " DAY_FMT " %Y";
else
fmt = bsdtar->day_first ? DAY_FMT " %b %H:%M" : "%b " DAY_FMT " %H:%M";
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ ltime = localtime_s(&tmbuf, &tim) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
ltime = localtime_r(&tim, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = tim;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- ltime = NULL;
- else
- ltime = &tmbuf;
#else
ltime = localtime(&tim);
#endif