diff options
Diffstat (limited to 'libraries/base/GHC/IO/FD.hs')
-rw-r--r-- | libraries/base/GHC/IO/FD.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libraries/base/GHC/IO/FD.hs b/libraries/base/GHC/IO/FD.hs index 2cb71b35dc..9e1a8cf08e 100644 --- a/libraries/base/GHC/IO/FD.hs +++ b/libraries/base/GHC/IO/FD.hs @@ -35,7 +35,6 @@ import GHC.Show import GHC.Enum import GHC.IO -import GHC.IO.Types import GHC.IO.IOMode import GHC.IO.Buffer import GHC.IO.BufferedIO @@ -332,17 +331,17 @@ close fd = throwErrnoIfMinus1Retry_ "GHC.IO.FD.close" $ #if defined(mingw32_HOST_OS) if fdIsSocket fd then - c_closesocket (fromIntegral $ toFd realFd) + c_closesocket (fromIntegral realFd) else #endif - c_close (fromIntegral $ toFd realFd) + c_close (fromIntegral realFd) -- release the lock *first*, because otherwise if we're preempted -- after closing but before releasing, the FD may have been reused. -- (#7646) release fd - closeWith closer (fromIntegral (fdFD fd) :: Fd) + closeFdWith closer (fromIntegral (fdFD fd)) release :: FD -> IO () release fd = do _ <- unlockFile (fromIntegral $ fdFD fd) |