Don't block when doing 'exec wait', and reading from pipe.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 16 Apr 2010 14:12:01 +0000 (16:12 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 16 Apr 2010 14:14:53 +0000 (16:14 +0200)
commitee478c06e48fc57190d20e9cf708c413efa89399
tree39772f93a7f927c6df7fd96bd6db0aa9bfada586
parenta2b12c6682e567e2e20f19bc989ac897ec2158f1
Don't block when doing 'exec wait', and reading from pipe.

If the child is slow, then reading from the pipe will block until
the child exits.  This will happen even if we intend later to wait
only 10 seconds for the child pid.

The solution is to call select() on the pipe.  After 10 seconds,
if no progress has been made: kill -TERM the child, close the pipe,
and clean up the child PID.
src/main/exec.c