aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--System/Posix/IO.hsc3
1 files changed, 2 insertions, 1 deletions
diff --git a/System/Posix/IO.hsc b/System/Posix/IO.hsc
index 7835b18..4f993b2 100644
--- a/System/Posix/IO.hsc
+++ b/System/Posix/IO.hsc
@@ -241,12 +241,13 @@ fdToHandle :: Fd -> IO Handle
handleToFd h@(FileHandle _ m) = do
withHandle' "handleToFd" h m $ handleToFd' h
handleToFd h@(DuplexHandle _ r w) = do
- withHandle' "handleToFd" h r $ handleToFd' h
+ _ <- withHandle' "handleToFd" h r $ handleToFd' h
withHandle' "handleToFd" h w $ handleToFd' h
-- for a DuplexHandle, make sure we mark both sides as closed,
-- otherwise a finalizer will come along later and close the other
-- side. (#3914)
+handleToFd' :: Handle -> Handle__ -> IO (Handle__, Fd)
handleToFd' h h_@Handle__{haType=_,..} = do
case cast haDevice of
Nothing -> ioError (ioeSetErrorString (mkIOError IllegalOperation