on master help sign in
Mark a Handle as closed when we're done with it

--HG-- extra : convert_revision : ed59bbd7070e9b918179ff4dc8596719d0829eba

commit5d980d0c23ce1b14d9d016723e035e25b954ef4f authorBryan O'Sullivan <bos@serpentine.com> dateThu 26 Aug 2010, 01:18 (16 years ago) parent04f2b53
1 file changed+2−2
Data/Text/IO.hs+2−2
Data/Text/IO.hs+2−2
@@ -55,7 +55,7 @@ import GHC.IO.Handle.Internals (augmentIOError, hClose_help, wantReadableHandle,
5555 wantWritableHandle)
5656import GHC.IO.Handle.Text (commitBuffer')
5757import GHC.IO.Handle.Types (BufferList(..), BufferMode(..), Handle__(..),
58− Newline(..))
58+ HandleType(..), Newline(..))
5959import System.IO (hGetBuffering, hFileSize, hSetBuffering, hTell)
6060import System.IO.Error (isEOFError)
6161#endif
@@ -94,7 +94,7 @@ hGetContents h = do
9494 chooseGoodBuffering h
9595 wantReadableHandle "hGetContents" h $ \hh -> do
9696 (hh',ts) <- readAll hh
97− return (hh',T.concat ts)
97+ return (hh'{haType=ClosedHandle},T.concat ts)
9898 where
9999 readAll hh@Handle__{..} = do
100100 buf <- readIORef haCharBuffer