From: Simon Marlow Date: Tue, 23 Jun 2009 10:50:04 +0000 (+0000) Subject: fix bug in partial writes X-Git-Tag: 2009-06-25~7 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a5ab321d288ec88c8e6cdce4f9d86bd323938bd9;p=ghc-base.git fix bug in partial writes --- 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