[project @ 2003-07-08 15:46:40 by panne]
[haskell-directory.git] / GHC / IO.hs
index a192a67..914a55a 100644 (file)
--- a/GHC/IO.hs
+++ b/GHC/IO.hs
@@ -33,10 +33,10 @@ import Foreign.C
 import System.IO.Error
 import Data.Maybe
 import Control.Monad
+import System.Posix.Internals
 
 import GHC.Enum
 import GHC.Base
-import GHC.Posix
 import GHC.IOBase
 import GHC.Handle      -- much of the real stuff is in here
 import GHC.Real
@@ -98,7 +98,9 @@ hGetChar handle =
        new_buf <- fillReadBuffer fd True (haIsStream handle_) buf
        hGetcBuffered fd ref new_buf
     BlockBuffering _ -> do
-       new_buf <- fillReadBuffer fd False (haIsStream handle_) buf
+       new_buf <- fillReadBuffer fd True (haIsStream handle_) buf
+               --                   ^^^^
+               -- don't wait for a completely full buffer.
        hGetcBuffered fd ref new_buf
     NoBuffering -> do
        -- make use of the minimal buffer we already have