summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2017-04-21 20:11:35 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-21 20:19:09 -0400
commit3d7c489404a0b08c35a1547bff6ab04cb1c30b00 (patch)
tree46d34024eaa73e782d404bd8bb29a1463012480c /libraries/base
parent363f7fd4183a302b3616233c5996dfadf345fb01 (diff)
downloadhaskell-3d7c489404a0b08c35a1547bff6ab04cb1c30b00.tar.gz
base: update comment to match the change from e134af01
Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3484
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/GHC/IO/Handle/Lock.hsc5
1 files changed, 2 insertions, 3 deletions
diff --git a/libraries/base/GHC/IO/Handle/Lock.hsc b/libraries/base/GHC/IO/Handle/Lock.hsc
index ebb3ce4a4e..b2c64c4b22 100644
--- a/libraries/base/GHC/IO/Handle/Lock.hsc
+++ b/libraries/base/GHC/IO/Handle/Lock.hsc
@@ -127,9 +127,8 @@ lockImpl h ctx mode block = do
-- We want to lock the whole file without looking up its size to be
-- consistent with what flock does. According to documentation of LockFileEx
-- "locking a region that goes beyond the current end-of-file position is
- -- not an error", however some versions of Windows seem to have issues with
- -- large regions and set ERROR_INVALID_LOCK_RANGE in such case for
- -- mysterious reasons. Work around that by setting only low 32 bits.
+ -- not an error", hence we pass maximum value as the number of bytes to
+ -- lock.
fix $ \retry -> c_LockFileEx wh flags 0 0xffffffff 0xffffffff ovrlpd >>= \case
True -> return True
False -> getLastError >>= \err -> if