Fix goGraph.
authorMatt McCutchen <matt@mattmccutchen.net>
Mon, 18 Jul 2011 23:22:27 +0000 (19:22 -0400)
committerMatt McCutchen <matt@mattmccutchen.net>
Mon, 18 Jul 2011 23:22:27 +0000 (19:22 -0400)
program/TestUtils.hs

index 0259630..8bc1e32 100644 (file)
@@ -71,14 +71,11 @@ goGraph theGraph =
        -- First generate graphviz code.
        let gvCode = graphviz' theGraph in do
        -- Then have `dot' convert it to postscript in a file.
-       (rH, wH) <- createHandlePipe
        pt <- epochTime
        let fname = "graph-" ++ show pt ++ ".ps"
-       dotPid <- runProcess "dot" ["-Tps", "-o", fname]
-               Nothing Nothing (Just rH) Nothing Nothing
-       forkIO (do
-               hPutStr wH gvCode
-               hClose wH)
+       (Just wH, _, _, dotPid) <- createProcess (proc "dot" ["-Tps", "-o", fname]) {std_in = CreatePipe}
+       hPutStr wH gvCode
+       hClose wH
        waitForProcess dotPid
        -- Then open the file.
        goFile fname