X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=059d692df697d59c06b8580de739b2429cfe0438;hb=0b60725b6817a819b0d3c5ad940aef3eda008b88;hp=933a98e44437062c928bf6d6624d21f228b04a38;hpb=0f66260b5afc88accb6af6a09b20c3a4de51c39a;p=ghc-hetmet.git diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 933a98e..059d692 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -96,10 +96,6 @@ import GHC.TopHandler import Data.IORef ( IORef, readIORef, writeIORef ) -#ifdef USE_EDITLINE -import System.Posix.Internals ( setNonBlockingFD ) -#endif - ----------------------------------------------------------------------------- ghciWelcomeMsg :: String @@ -641,11 +637,8 @@ readlineLoop = do return (Just str) withReadline :: IO a -> IO a -withReadline = bracket_ stopTimer (do startTimer; setNonBlockingFD 0) - -- Two problems are being worked around here: - -- 1. readline sometimes puts stdin into blocking mode, - -- so we need to put it back for the IO library - -- 2. editline doesn't handle some of its system calls returning +withReadline = bracket_ stopTimer startTimer + -- editline doesn't handle some of its system calls returning -- EINTR, so our timer signal confuses it, hence we turn off -- the timer signal when making calls to editline. (#2277) -- If editline is ever fixed, we can remove this.