aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-12-03 11:22:49 +0000
committerCorinna Vinschen <corinna@vinschen.de>2003-12-03 11:22:49 +0000
commitd2fa946e51347ace19fa1c5a78ebb4fa6e2a2cba (patch)
tree7eb0aad773c6773550a803ed9fbfbda188cc9e73 /winsup
parent184351740197f009e0630a182acd4422024d6ab4 (diff)
downloadnewlib-d2fa946e51347ace19fa1c5a78ebb4fa6e2a2cba.zip
newlib-d2fa946e51347ace19fa1c5a78ebb4fa6e2a2cba.tar.gz
newlib-d2fa946e51347ace19fa1c5a78ebb4fa6e2a2cba.tar.bz2
* fhandler_disk_file.cc (fhandler_disk_file::lock): Use UINT32_MAX
instead of 0xffffffff. Accomodate Win 9x bug in evaluating length of area to lock when given length is 0.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc9
2 files changed, 12 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 8f96fba..3f329ed 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-03 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_disk_file.cc (fhandler_disk_file::lock): Use UINT32_MAX
+ instead of 0xffffffff. Accomodate Win 9x bug in evaluating length
+ of area to lock when given length is 0.
+
2003-12-03 Pierre Humblet <pierre.humblet@ieee.org>
* fhandler_disk_file.cc (fhandler_disk_file::lock): Interchange
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 2c8829c..d2adac6 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -536,18 +536,21 @@ fhandler_disk_file::lock (int cmd, struct __flock64 *fl)
DWORD off_high, off_low, len_high, len_low;
- off_low = (DWORD)(win32_start & 0xffffffff);
+ off_low = (DWORD)(win32_start & UINT32_MAX);
off_high = (DWORD)(win32_start >> 32);
if (win32_len == 0)
{
/* Special case if len == 0 for POSIX means lock to the end of
the entire file (and all future extensions). */
- len_low = 0xffffffff;
+ /* CV, 2003-12-03: And yet another Win 9x bugginess. For some reason
+ offset + length must be <= 0x100000000. I'm using 0xffffffff as
+ upper border here, this should be sufficient. */
+ len_low = UINT32_MAX - (wincap.lock_file_highword () ? 0 : off_low);
len_high = wincap.lock_file_highword ();
}
else
{
- len_low = (DWORD)(win32_len & 0xffffffff);
+ len_low = (DWORD)(win32_len & UINT32_MAX);
len_high = (DWORD)(win32_len >> 32);
}