diff options
author | pfg <pfg@FreeBSD.org> | 2013-06-01 14:16:51 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-06-01 14:16:51 +0000 |
commit | 5750b86515d75792972b36539d4a3e166b31d925 (patch) | |
tree | 9ccb38c88a217d3ef08308907c0059fbf9ebb79c /contrib/binutils/bfd/archive.c | |
parent | bfce0b30fa1e29d33ded21e07c6ecbc40c95de0d (diff) | |
download | FreeBSD-src-5750b86515d75792972b36539d4a3e166b31d925.zip FreeBSD-src-5750b86515d75792972b36539d4a3e166b31d925.tar.gz |
BFD: Use time_t instead of long for archive timestamps.
This basically follows the suggestion in the binutils code and is more
in line with what BSD ar(1) does.
Obtained from: OpenBSD
MFC after: 2 weeks.
Diffstat (limited to 'contrib/binutils/bfd/archive.c')
-rw-r--r-- | contrib/binutils/bfd/archive.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c index 053ad47..12bb714 100644 --- a/contrib/binutils/bfd/archive.c +++ b/contrib/binutils/bfd/archive.c @@ -1390,8 +1390,8 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, const char *filename, bfd *member) /* ar headers are space padded, not null padded! */ memset (hdr, ' ', sizeof (struct ar_hdr)); - _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", - status.st_mtime); + _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", + (long long)status.st_mtime); #ifdef HPUX_LARGE_AR_IDS /* HP has a very "special" way to handle UID/GID's with numeric values > 99999. */ @@ -1458,6 +1458,11 @@ bfd_generic_stat_arch_elt (bfd *abfd, struct stat *buf) if (aloser == hdr->arelt) \ return -1; +#define fooll(arelt, stelt, size) \ + buf->stelt = strtoll (hdr->arelt, &aloser, size); \ + if (aloser == hdr->arelt) \ + return -1; + /* Some platforms support special notations for large IDs. */ #ifdef HPUX_LARGE_AR_IDS # define foo2(arelt, stelt, size) \ @@ -1484,7 +1489,7 @@ bfd_generic_stat_arch_elt (bfd *abfd, struct stat *buf) # define foo2(arelt, stelt, size) foo (arelt, stelt, size) #endif - foo (ar_date, st_mtime, 10); + fooll (ar_date, st_mtime, 10); foo2 (ar_uid, st_uid, 10); foo2 (ar_gid, st_gid, 10); foo (ar_mode, st_mode, 8); |