System.Process bugs on Unix

John Goerzen jgoerzen at complete.org
Wed Mar 28 14:50:08 EDT 2007


I have another concern about System.Process.  I have this code:

    (recordfn, recordh) <- openTempFile macdir "new-"
...
    (c1, macroh, c2, xmacroph) <- runInteractiveProcess "xmacrorec2"
                                   ["-k", "0xffff"] Nothing Nothing
...
    grepph <- runProcess "egrep" ["-v", "^(ButtonRelease|ButtonPress|MotionNotify)"]
               Nothing Nothing (Just macroh) (Just recordh) Nothing

Now, egrep is dying with:

grep: (standard input): Resource temporarily unavailable

And strace shows that, sure enough, read(0,...) in grep is getting
EAGAIN.

Sounds like somebody forgot to take the fd out of non-blocking mode.

This renders runProcess pretty well useless, IMHO.

-- John



More information about the Libraries mailing list