projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a72a7e3
)
check for ClosedHandle in read/write operations on DuplexHandles (#4808)
author
Simon Marlow
<marlowsd@gmail.com>
Wed, 1 Dec 2010 10:51:14 +0000
(10:51 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Wed, 1 Dec 2010 10:51:14 +0000
(10:51 +0000)
GHC/IO/Handle/Internals.hs
patch
|
blob
|
history
diff --git
a/GHC/IO/Handle/Internals.hs
b/GHC/IO/Handle/Internals.hs
index
1e48e8b
..
2aad185
100644
(file)
--- a/
GHC/IO/Handle/Internals.hs
+++ b/
GHC/IO/Handle/Internals.hs
@@
-220,7
+220,9
@@
wantWritableHandle :: String -> Handle -> (Handle__ -> IO a) -> IO a
wantWritableHandle fun h@(FileHandle _ m) act
= wantWritableHandle' fun h m act
wantWritableHandle fun h@(DuplexHandle _ _ m) act
wantWritableHandle fun h@(FileHandle _ m) act
= wantWritableHandle' fun h m act
wantWritableHandle fun h@(DuplexHandle _ _ m) act
- = withHandle_' fun h m act
+ = wantWritableHandle' fun h m act
+ -- we know it's not a ReadHandle or ReadWriteHandle, but we have to
+ -- check for ClosedHandle/SemiClosedHandle. (#4808)
wantWritableHandle'
:: String -> Handle -> MVar Handle__
wantWritableHandle'
:: String -> Handle -> MVar Handle__
@@
-257,7
+259,9
@@
wantReadableHandle_ :: String -> Handle -> (Handle__ -> IO a) -> IO a
wantReadableHandle_ fun h@(FileHandle _ m) act
= wantReadableHandle' fun h m act
wantReadableHandle_ fun h@(DuplexHandle _ m _) act
wantReadableHandle_ fun h@(FileHandle _ m) act
= wantReadableHandle' fun h m act
wantReadableHandle_ fun h@(DuplexHandle _ m _) act
- = withHandle_' fun h m act
+ = wantReadableHandle' fun h m act
+ -- we know it's not a WriteHandle or ReadWriteHandle, but we have to
+ -- check for ClosedHandle/SemiClosedHandle. (#4808)
wantReadableHandle'
:: String -> Handle -> MVar Handle__
wantReadableHandle'
:: String -> Handle -> MVar Handle__