Commit 0862dcc5 authored by joeyadams's avatar joeyadams
Browse files

BufferedIO: fix bug in writeBufNonBlocking introduced by commit 7d39e100

bufferAdjustL does nothing but update bufL, and set bufL = bufR = 0
when bufL == bufR.  It ignores the old bufL.

writeBufNonBlocking is currently unused.  It is only used to implement
flushWriteBuffer0, which is never called by base
(hPutBufNonBlocking uses a blocking flush).
parent d7b5f524
......@@ -123,5 +123,5 @@ writeBufNonBlocking dev bbuf = do
let bytes = bufferElems bbuf
res <- withBuffer bbuf $ \ptr ->
IODevice.writeNonBlocking dev (ptr `plusPtr` bufL bbuf) bytes
return (res, bufferAdjustL res bbuf)
return (res, bufferAdjustL (bufL bbuf + res) bbuf)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment