@@ -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