module Mixlib::ShellOut::Unix

def attempt_reap

Try to reap the child process but don't block if it isn't dead yet.
def attempt_reap
  if results = Process.waitpid2(@child_pid, Process::WNOHANG)
    @reaped = true
    @status = results.last
  else
    nil
  end
end