polysquare/yiqi — pull request #7 by smspillaz (2013-05-07 06:05:41+00:00)
Title: Rewrite the launchBinary code to make it exception safe.

Pipe represents a normal unix pipe and will close both its
read and write ends on destruction if they are nonzero.

RedirectedFileDescriptor represents a duplicated fd
which reverts back to its previous state on
destruction.

launchBinary was split into launchBinary (which actually
captures the stdout) and launchBinaryAndWaitForReturn
which launches the binary and waits for it to finish
executing.

Fixes #5