puppetlabs/cfacter — pull request #160 by peterhuene (2014-10-04 00:00:17+00:00)
Title: (CFACT-135) Fix forked process cleanup if execv fails.

When execv fails, we call exit to immediately exit the child process.
In C++11, exit calls global destructors. One of the destructors being
called is facter::ruby::api to cleanup the Ruby VM.

However, the Ruby VM appears to have process affinity and doesn't like
having ruby_cleanup called from a forked child process.

To work around the fact that some stdlib implementations don't have
quick_exit implemented, we disable the api object from performing any
cleanup in the forked process.