diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-04-24 14:35:14 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-05-14 21:05:36 -0400 |
commit | 00330cd18a4ba83beabad4cb9f4215170828cd29 (patch) | |
tree | 5e2c26d6fa4f383e0ac7e933f33005d6b136fbcd /sim/common/callback.c | |
parent | fcf102ba7abe6c8a64b2db41bfd02ac80e79e094 (diff) | |
download | binutils-00330cd18a4ba83beabad4cb9f4215170828cd29.zip binutils-00330cd18a4ba83beabad4cb9f4215170828cd29.tar.gz binutils-00330cd18a4ba83beabad4cb9f4215170828cd29.tar.bz2 |
sim: callback: convert time interface to 64-bit
PR sim/27705
Rather than rely on time_t being the right size between the host &
target, have the interface always be 64-bit. We can figure out if
we need to truncate when actually outputting it to the right target.
Diffstat (limited to 'sim/common/callback.c')
-rw-r--r-- | sim/common/callback.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sim/common/callback.c b/sim/common/callback.c index 1b53823..fb5e864 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -420,12 +420,12 @@ os_system (host_callback *p, const char *s) return result; } -static long -os_time (host_callback *p, long *t) +static int64_t +os_time (host_callback *p) { - long result; + int64_t result; - result = time (t); + result = time (NULL); p->last_errno = errno; return result; } @@ -466,7 +466,7 @@ os_fstat (host_callback *p, int fd, struct stat *buf) if (p->ispipe[fd]) { #if defined (HAVE_STRUCT_STAT_ST_ATIME) || defined (HAVE_STRUCT_STAT_ST_CTIME) || defined (HAVE_STRUCT_STAT_ST_MTIME) - time_t t = (*p->time) (p, NULL); + time_t t = (*p->time) (p); #endif /* We have to fake the struct stat contents, since the pipe is |