diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/header_verbose_list.c | 34 | ||||
-rw-r--r-- | archival/rpm.c | 6 |
2 files changed, 24 insertions, 16 deletions
diff --git a/archival/libunarchive/header_verbose_list.c b/archival/libunarchive/header_verbose_list.c index da21a15af..f6f04cfd5 100644 --- a/archival/libunarchive/header_verbose_list.c +++ b/archival/libunarchive/header_verbose_list.c | |||
@@ -8,7 +8,8 @@ | |||
8 | 8 | ||
9 | void FAST_FUNC header_verbose_list(const file_header_t *file_header) | 9 | void FAST_FUNC header_verbose_list(const file_header_t *file_header) |
10 | { | 10 | { |
11 | struct tm *mtime = localtime(&(file_header->mtime)); | 11 | struct tm tm_time; |
12 | struct tm *ptm = &tm_time; //localtime(&file_header->mtime); | ||
12 | 13 | ||
13 | #if ENABLE_FEATURE_TAR_UNAME_GNAME | 14 | #if ENABLE_FEATURE_TAR_UNAME_GNAME |
14 | char uid[sizeof(int)*3 + 2]; | 15 | char uid[sizeof(int)*3 + 2]; |
@@ -16,6 +17,8 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) | |||
16 | char *user; | 17 | char *user; |
17 | char *group; | 18 | char *group; |
18 | 19 | ||
20 | localtime_r(&file_header->mtime, ptm); | ||
21 | |||
19 | user = file_header->tar__uname; | 22 | user = file_header->tar__uname; |
20 | if (user == NULL) { | 23 | if (user == NULL) { |
21 | sprintf(uid, "%u", (unsigned)file_header->uid); | 24 | sprintf(uid, "%u", (unsigned)file_header->uid); |
@@ -31,26 +34,31 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header) | |||
31 | user, | 34 | user, |
32 | group, | 35 | group, |
33 | file_header->size, | 36 | file_header->size, |
34 | 1900 + mtime->tm_year, | 37 | 1900 + ptm->tm_year, |
35 | 1 + mtime->tm_mon, | 38 | 1 + ptm->tm_mon, |
36 | mtime->tm_mday, | 39 | ptm->tm_mday, |
37 | mtime->tm_hour, | 40 | ptm->tm_hour, |
38 | mtime->tm_min, | 41 | ptm->tm_min, |
39 | mtime->tm_sec, | 42 | ptm->tm_sec, |
40 | file_header->name); | 43 | file_header->name); |
44 | |||
41 | #else /* !FEATURE_TAR_UNAME_GNAME */ | 45 | #else /* !FEATURE_TAR_UNAME_GNAME */ |
46 | |||
47 | localtime_r(&file_header->mtime, ptm); | ||
48 | |||
42 | printf("%s %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", | 49 | printf("%s %u/%u %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s", |
43 | bb_mode_string(file_header->mode), | 50 | bb_mode_string(file_header->mode), |
44 | (unsigned)file_header->uid, | 51 | (unsigned)file_header->uid, |
45 | (unsigned)file_header->gid, | 52 | (unsigned)file_header->gid, |
46 | file_header->size, | 53 | file_header->size, |
47 | 1900 + mtime->tm_year, | 54 | 1900 + ptm->tm_year, |
48 | 1 + mtime->tm_mon, | 55 | 1 + ptm->tm_mon, |
49 | mtime->tm_mday, | 56 | ptm->tm_mday, |
50 | mtime->tm_hour, | 57 | ptm->tm_hour, |
51 | mtime->tm_min, | 58 | ptm->tm_min, |
52 | mtime->tm_sec, | 59 | ptm->tm_sec, |
53 | file_header->name); | 60 | file_header->name); |
61 | |||
54 | #endif /* FEATURE_TAR_UNAME_GNAME */ | 62 | #endif /* FEATURE_TAR_UNAME_GNAME */ |
55 | 63 | ||
56 | if (file_header->link_target) { | 64 | if (file_header->link_target) { |
diff --git a/archival/rpm.c b/archival/rpm.c index cdaf50fa9..6c1e341cd 100644 --- a/archival/rpm.c +++ b/archival/rpm.c | |||
@@ -145,13 +145,13 @@ int rpm_main(int argc, char **argv) | |||
145 | if (func & rpm_query_info) { | 145 | if (func & rpm_query_info) { |
146 | /* Do the nice printout */ | 146 | /* Do the nice printout */ |
147 | time_t bdate_time; | 147 | time_t bdate_time; |
148 | struct tm *bdate; | 148 | struct tm *bdate_ptm; |
149 | char bdatestring[50]; | 149 | char bdatestring[50]; |
150 | printf("Name : %-29sRelocations: %s\n", rpm_getstr(TAG_NAME, 0), rpm_getstr(TAG_PREFIXS, 0) ? rpm_getstr(TAG_PREFIXS, 0) : "(not relocateable)"); | 150 | printf("Name : %-29sRelocations: %s\n", rpm_getstr(TAG_NAME, 0), rpm_getstr(TAG_PREFIXS, 0) ? rpm_getstr(TAG_PREFIXS, 0) : "(not relocateable)"); |
151 | printf("Version : %-34sVendor: %s\n", rpm_getstr(TAG_VERSION, 0), rpm_getstr(TAG_VENDOR, 0) ? rpm_getstr(TAG_VENDOR, 0) : "(none)"); | 151 | printf("Version : %-34sVendor: %s\n", rpm_getstr(TAG_VERSION, 0), rpm_getstr(TAG_VENDOR, 0) ? rpm_getstr(TAG_VENDOR, 0) : "(none)"); |
152 | bdate_time = rpm_getint(TAG_BUILDTIME, 0); | 152 | bdate_time = rpm_getint(TAG_BUILDTIME, 0); |
153 | bdate = localtime((time_t *) &bdate_time); | 153 | bdate_ptm = localtime(&bdate_time); |
154 | strftime(bdatestring, 50, "%a %d %b %Y %T %Z", bdate); | 154 | strftime(bdatestring, 50, "%a %d %b %Y %T %Z", bdate_ptm); |
155 | printf("Release : %-30sBuild Date: %s\n", rpm_getstr(TAG_RELEASE, 0), bdatestring); | 155 | printf("Release : %-30sBuild Date: %s\n", rpm_getstr(TAG_RELEASE, 0), bdatestring); |
156 | printf("Install date: %-30sBuild Host: %s\n", "(not installed)", rpm_getstr(TAG_BUILDHOST, 0)); | 156 | printf("Install date: %-30sBuild Host: %s\n", "(not installed)", rpm_getstr(TAG_BUILDHOST, 0)); |
157 | printf("Group : %-30sSource RPM: %s\n", rpm_getstr(TAG_GROUP, 0), rpm_getstr(TAG_SOURCERPM, 0)); | 157 | printf("Group : %-30sSource RPM: %s\n", rpm_getstr(TAG_GROUP, 0), rpm_getstr(TAG_SOURCERPM, 0)); |