X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO.hs;h=a5e34f2f83fa9b873a9ed614e4161e4390c627c7;hb=b1c845d526296f874ef33fd1a4568c7dfe63c55b;hp=7ca3e6ecd5b0270967dc12a6170bf3b5493ba186;hpb=57c5c671f24503a2e3d3205e7a70ce0a66bab2e1;p=ghc-base.git diff --git a/GHC/IO.hs b/GHC/IO.hs index 7ca3e6e..a5e34f2 100644 --- a/GHC/IO.hs +++ b/GHC/IO.hs @@ -93,7 +93,11 @@ hWaitForInput h msecs = do fdReady (haFD handle_) 0 {- read -} (fromIntegral msecs) (fromIntegral $ fromEnum $ haIsStream handle_) - return (r /= 0) + if r /= 0 then do -- Call hLookAhead' to throw an EOF + -- exception if appropriate + hLookAhead' handle_ + return True + else return False foreign import ccall safe "fdReady" fdReady :: CInt -> CInt -> CInt -> CInt -> IO CInt