X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO%2FHandle%2FText.hs;h=168a5a5acf6d4212b3dfde4cb21e3da5a1a0afdc;hb=7d39e10019df33f1a19d65b3c58c4d01a7dc8d30;hp=754be0285abc91a4eb8dc4ed9ac204088b599d72;hpb=ee7be4593b1b17d4ef45c37963b8b19d53865ab6;p=ghc-base.git diff --git a/GHC/IO/Handle/Text.hs b/GHC/IO/Handle/Text.hs index 754be02..168a5a5 100644 --- a/GHC/IO/Handle/Text.hs +++ b/GHC/IO/Handle/Text.hs @@ -748,9 +748,9 @@ bufWrite h_@Handle__{..} ptr count can_block = -- else, we have to flush else do debugIO "hPutBuf: flushing first" - Buffered.flushWriteBuffer haDevice old_buf + old_buf' <- Buffered.flushWriteBuffer haDevice old_buf -- TODO: we should do a non-blocking flush here - writeIORef haByteBuffer old_buf{bufL=0,bufR=0} + writeIORef haByteBuffer old_buf' -- if we can fit in the buffer, then just loop if count < size then bufWrite h_ ptr count can_block