summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-05-17 19:30:52 +0000
committerChristopher Faylor <me@cgf.cx>2002-05-17 19:30:52 +0000
commitb05b7d84d6bd29dd07d0b493dad8d4d48493db3e (patch)
treedfc6534c8be883dc05924e0a704584bd31fe6972 /winsup/cygwin
parentc7ba2cc096244fe6626f4d0f2069c9364328a5e2 (diff)
downloadcygnal-b05b7d84d6bd29dd07d0b493dad8d4d48493db3e.tar.gz
cygnal-b05b7d84d6bd29dd07d0b493dad8d4d48493db3e.tar.bz2
cygnal-b05b7d84d6bd29dd07d0b493dad8d4d48493db3e.zip
* fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with high
order part of 64 bit address on OS's which do not support that kind of operation. Otherwise Windows 95 will become confused.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/fhandler.cc12
2 files changed, 16 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 3e57d1c71..deac45f44 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-17 Christopher Faylor <cgf@redhat.com>
+
+ * fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with
+ high order part of 64 bit address on OS's which do not support that
+ kind of operation. Otherwise Windows 95 will become confused.
+
2002-05-16 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler_raw.cc (fhandler_dev_raw::open): Replace set_errno()
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index dd7aeb2e7..d1b0a4afc 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -732,9 +732,17 @@ fhandler_base::lseek (__off64_t offset, int whence)
: (whence == SEEK_CUR ? FILE_CURRENT : FILE_END);
LONG off_low = offset & 0xffffffff;
- LONG off_high = wincap.has_64bit_file_access () ? offset >> 32 : 0;
+ LONG *poff_high, off_high;
+ if (!wincap.has_64bit_file_access ())
+ poff_high = NULL;
+ else
+ {
+ off_high = offset >> 32;
+ poff_high = &off_high;
+ }
- res = SetFilePointer (get_handle(), off_low, &off_high, win32_whence);
+ debug_printf ("setting file pointer to %u (high), %u (low)", off_high, off_low);
+ res = SetFilePointer (get_handle(), off_low, poff_high, win32_whence);
if (res == INVALID_SET_FILE_POINTER && GetLastError ())
{
__seterrno ();