Commit aef250c3 authored by sof's avatar sof
Browse files

[project @ 1999-02-25 10:18:28 by sof]

hClose: don't raise an exception when passed a handle that's already closed,
i.e.,

    h <- openFile "a" ReadMode >> hClose h >> hClose h

will now succeed (provided 'a' exists and is readable, of course.)
Repeated hClose's are just redundant.
parent 35f92df0
......@@ -365,7 +365,7 @@ hClose handle =
ioError theError
ClosedHandle -> do
writeHandle handle handle_
ioe_closedHandle "hClose" handle
return ()
_ -> do
rc <- CCALL(closeFile) (haFO__ handle_) (1::Int){-flush if you can-} -- ConcHask: SAFE, won't block
{- We explicitly close a file object so that we can be told
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment