diff options
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/win32/win32.c b/win32/win32.c index 4804359794..7cb1b31df6 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4676,18 +4676,15 @@ rb_w32_uaccess(const char *path, int mode) static int rb_chsize(HANDLE h, off_t size) { - long upos, lpos, usize, lsize, uend, lend; - off_t end; + long upos, lpos, usize, lsize; int ret = -1; DWORD e; - if (((lpos = SetFilePointer(h, 0, (upos = 0, &upos), SEEK_CUR)) == -1L && - (e = GetLastError())) || - ((lend = GetFileSize(h, (DWORD *)&uend)) == -1L && (e = GetLastError()))) { + if ((lpos = SetFilePointer(h, 0, (upos = 0, &upos), SEEK_CUR)) == -1L && + (e = GetLastError())) { errno = map_errno(e); return -1; } - end = ((off_t)uend << 32) | (unsigned long)lend; usize = (long)(size >> 32); lsize = (long)size; if (SetFilePointer(h, lsize, &usize, SEEK_SET) == (DWORD)-1L && |