From: simonmar Date: Fri, 21 Jan 2005 15:12:21 +0000 (+0000) Subject: [project @ 2005-01-21 15:12:21 by simonmar] X-Git-Tag: nhc98-1-18-release~88 X-Git-Url: http://git.megacz.com/?p=haskell-directory.git;a=commitdiff_plain;h=bdcf7efb348fab0c8d398f341d596aa024516a82 [project @ 2005-01-21 15:12:21 by simonmar] hClose on stdin,stdout,stderr now actually closes the file descriptor. Before, there was no way to actually close these file descriptors, which might be necessary in some cases - especially when stdin/stdout are pipes and you need to indicate to the other end of the pipe that you've finished I/O, but without exiting the program. --- diff --git a/GHC/Handle.hs b/GHC/Handle.hs index a822696..16a9a2f 100644 --- a/GHC/Handle.hs +++ b/GHC/Handle.hs @@ -1039,11 +1039,9 @@ hClose_handle_ handle_ = do c_fd = fromIntegral fd -- close the file descriptor, but not when this is the read - -- side of a duplex handle, and not when this is one of the - -- std file handles. + -- side of a duplex handle. case haOtherSide handle_ of Nothing -> - when (fd /= fd_stdin && fd /= fd_stdout && fd /= fd_stderr) $ throwErrnoIfMinus1Retry_ "hClose" #ifdef mingw32_TARGET_OS (closeFd (haIsStream handle_) c_fd)