[commit: bytestring] ghc-7.6: Fix implementation of hPutNonBlocking for non-GHC (8a872af)
Paolo Capriotti
p.capriotti at gmail.com
Thu Sep 6 12:28:45 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/bytestring
On branch : ghc-7.6
http://hackage.haskell.org/trac/ghc/changeset/8a872af8959d88d0a9579581d37ec4c8d205c042
>---------------------------------------------------------------
commit 8a872af8959d88d0a9579581d37ec4c8d205c042
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 eee8944..426cede 100644
--- a/Data/ByteString.hs
+++ b/Data/ByteString.hs
@@ -1808,13 +1808,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