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:43 +0000 (16:14 +0200)
commit32177859e268a82b7d59d3645e5012c16db7d7df
tree68548a726ce2467de4ff68b0ec5291e83acf4ceb
parentbcc8a677a29529f68c4921b541e7bc3e0c286a6e
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