redding/scmd — pull request #21 by kellyredding (2013-11-07 22:52:49+00:00)
Title: use a "self-pipe" to handle cmd timeouts

This switches to defining a stop "self-pipe" for signaling when the
child process has exited. Intead of looping in the `wait_for_exit`
and checking if you've timed out every `WAIT_INTERVAL`, you instead
just select on the stop pipe with a timeout (or not). The thread
streaming the child process output also checks if the child process
has exited. If it has the stream thread writes to the stop pipe
which triggers the wait to end.

Closes #14.

@jcredding ready for review.