From 9c15c1015bd60dd837587e9cf4be67abe0995129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 30 Nov 2011 17:59:40 +0100 Subject: efile_drv: Fix casting between Sint64 and time_t --- erts/emulator/drivers/common/efile_drv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'erts/emulator/drivers/common/efile_drv.c') diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c index 184d27fb62..e7235c30f7 100644 --- a/erts/emulator/drivers/common/efile_drv.c +++ b/erts/emulator/drivers/common/efile_drv.c @@ -2124,9 +2124,10 @@ file_async_ready(ErlDrvData e, ErlDrvThreadData data) put_int32(d->info.size_low, &resbuf[1 + ( 1 * 4)]); put_int32(d->info.type, &resbuf[1 + ( 2 * 4)]); + /* Note 64 bit indexing in resbuf here */ put_int64(d->info.accessTime, &resbuf[1 + ( 3 * 4)]); put_int64(d->info.modifyTime, &resbuf[1 + ( 5 * 4)]); - put_int64(d->info.cTime , &resbuf[1 + ( 7 * 4)]); + put_int64(d->info.cTime, &resbuf[1 + ( 7 * 4)]); put_int32(d->info.mode, &resbuf[1 + ( 9 * 4)]); put_int32(d->info.links, &resbuf[1 + (10 * 4)]); @@ -2490,9 +2491,9 @@ file_output(ErlDrvData e, char* buf, int count) d->info.mode = get_int32(buf + 0 * 4); d->info.uid = get_int32(buf + 1 * 4); d->info.gid = get_int32(buf + 2 * 4); - d->info.accessTime = get_int64(buf + 3 * 4); - d->info.modifyTime = get_int64(buf + 5 * 4); - d->info.cTime = get_int64(buf + 7 * 4); + d->info.accessTime = (time_t)((Sint64)get_int64(buf + 3 * 4)); + d->info.modifyTime = (time_t)((Sint64)get_int64(buf + 5 * 4)); + d->info.cTime = (time_t)((Sint64)get_int64(buf + 7 * 4)); FILENAME_COPY(d->b, buf + 9*4); d->command = command; -- cgit v1.2.3