[commit: bytestring] ghc-7.6: Fix implementation of hPutNonBlocking for non-GHC (56413f2)
Ian Lynagh
igloo at earth.li
Thu Nov 29 16:17:59 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/bytestring
On branch : ghc-7.6
http://hackage.haskell.org/trac/ghc/changeset/56413f23849c164da9c211eb11c92ccb8522b212
>---------------------------------------------------------------
commit 56413f23849c164da9c211eb11c92ccb8522b212
Author: Duncan Coutts <duncan at community.haskell.org>
Date: Tue Aug 28 20:31:03 2012 +0000
Fix implementation of hPutNonBlocking for non-GHC
Spotted by Dan Burton
>---------------------------------------------------------------
Data/ByteString.hs | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Data/ByteString.hs b/Data/ByteString.hs
index aae63d6..3c05109 100644
--- a/Data/ByteString.hs
+++ b/Data/ByteString.hs
@@ -1796,13 +1796,12 @@ hPut h (PS ps s l) = withForeignPtr ps $ \p-> hPutBuf h (p `plusPtr` s) l
-- Note: on Windows and with Haskell implementation other than GHC, this
-- function does not work correctly; it behaves identically to 'hPut'.
--
-#if defined(__GLASGOW_HASKELL__)
hPutNonBlocking :: Handle -> ByteString -> IO ByteString
+#if defined(__GLASGOW_HASKELL__)
hPutNonBlocking h bs@(PS ps s l) = do
bytesWritten <- withForeignPtr ps $ \p-> hPutBufNonBlocking h (p `plusPtr` s) l
return $! drop bytesWritten bs
#else
-hPutNonBlocking :: Handle -> B.ByteString -> IO Int
hPutNonBlocking h bs = hPut h bs >> return empty
#endif
More information about the Cvs-libraries
mailing list