@@ -13,7 +13,7 @@ import Data.Word
1313import Data.Int
1414import Data.IORef
1515import qualified Data.IntMap as IntMap
16−-- import qualified Data.ByteString.Char8 as BS
16+import qualified Data.ByteString.Char8 as BSS
1717import qualified Data.ByteString.Lazy.Char8 as BS
1818
1919import Data.Binary (encode,decode)
@@ -80,10 +80,11 @@ mkTransport = do
8080 -- Note: Linux fifo semantics are NOT to block on open-RW, but this is not Posix standard.
8181 --
8282 -- We may protect from blocking other threads by running on a separate (OS) thread:
83− mv <- onOSThread$ PIO.openFd filename PIO.ReadWrite Nothing PIO.defaultFileFlags
83+-- mv <- onOSThread$ PIO.openFd filename PIO.ReadWrite Nothing PIO.defaultFileFlags
8484-- fd <- PIO.openFd filename PIO.ReadWrite Nothing PIO.defaultFileFlags
85−-- fd <- PIO.openFd filename PIO.WriteOnly Nothing PIO.defaultFileFlags
86− fd <- takeMVar mv
85+ fd <- PIO.openFd filename PIO.WriteOnly Nothing PIO.defaultFileFlags
86+-- fd <- takeMVar mv
87+ dbgprint1$ "GOT WRITING END OPEN ... "
8788
8889 return $
8990 -- Write to the named pipe. If the message is less than
@@ -130,7 +131,10 @@ mkTransport = do
130131
131132 let spinread :: Int64 -> IO BS.ByteString
132133 spinread desired = do
134+#ifdef DEBUG
133135-- hPutStr stderr "."
136+ BSS.hPutStr stdout (BSS.pack$ " "++show desired)
137+#endif
134138 (bytes,len) <- oneread desired
135139 case len of
136140 n | n == desired -> return bytes
@@ -151,8 +155,8 @@ mkTransport = do
151155 }
152156
153157#ifdef DEBUG
154−dbgprint2 = hPutStrLn stdout
155−dbgprint1 = hPutStrLn stderr
158+dbgprint1 s = BSS.hPutStrLn stderr (BSS.pack s)
159+dbgprint2 s = BSS.hPutStrLn stdout (BSS.pack s)
156160#else
157161dbgprint1 _ = return ()
158162dbgprint2 _ = return ()