projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix hReady (trac #1063)
[ghc-base.git]
/
GHC
/
IO.hs
diff --git
a/GHC/IO.hs
b/GHC/IO.hs
index
7ca3e6e
..
a5e34f2
100644
(file)
--- 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_)
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
foreign import ccall safe "fdReady"
fdReady :: CInt -> CInt -> CInt -> CInt -> IO CInt