[project @ 2005-01-28 10:15:44 by ross]
[ghc-base.git] / GHC / Handle.hs
index a822696..d433962 100644 (file)
@@ -56,6 +56,7 @@ module GHC.Handle (
 
 #include "ghcconfig.h"
 
+import System.Directory.Internals
 import Control.Monad
 import Data.Bits
 import Data.Maybe
@@ -63,7 +64,6 @@ import Foreign
 import Foreign.C
 import System.IO.Error
 import System.Posix.Internals
-import System.FilePath
 
 import GHC.Real
 
@@ -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)