Commits

Bryan O'Sullivan committed b5649aa

Mark a Handle as closed when we're done with it

Comments (0)

Files changed (1)

                                 wantWritableHandle)
 import GHC.IO.Handle.Text (commitBuffer')
 import GHC.IO.Handle.Types (BufferList(..), BufferMode(..), Handle__(..),
-                            Newline(..))
+                            HandleType(..), Newline(..))
 import System.IO (hGetBuffering, hFileSize, hSetBuffering, hTell)
 import System.IO.Error (isEOFError)
 #endif
   chooseGoodBuffering h
   wantReadableHandle "hGetContents" h $ \hh -> do
                    (hh',ts) <- readAll hh
-                   return (hh',T.concat ts)
+                   return (hh'{haType=ClosedHandle},T.concat ts)
  where
   readAll hh@Handle__{..} = do
     buf <- readIORef haCharBuffer