From a5ab321d288ec88c8e6cdce4f9d86bd323938bd9 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 23 Jun 2009 10:50:04 +0000 Subject: [PATCH] fix bug in partial writes --- GHC/IO/FD.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GHC/IO/FD.hs b/GHC/IO/FD.hs index 76c0242..44490fb 100644 --- a/GHC/IO/FD.hs +++ b/GHC/IO/FD.hs @@ -398,7 +398,7 @@ fdWrite fd ptr bytes = do res <- writeRawBufferPtr "GHC.IO.FD.fdWrite" fd ptr 0 (fromIntegral bytes) let res' = fromIntegral res if res' < bytes - then fdWrite fd (ptr `plusPtr` bytes) (bytes - res') + then fdWrite fd (ptr `plusPtr` res') (bytes - res') else return () -- XXX ToDo: this isn't non-blocking -- 1.7.10.4