module Mixlib::ShellOut::Unix

def propagate_pre_exec_failure

assume everything went well.
If it's there, un-marshal it and raise. If it's not there,
Attempt to get a Marshaled error from the side-channel.
def propagate_pre_exec_failure
  attempt_buffer_read until child_process_status.eof?
  e = Marshal.load(@process_status)
  raise(Exception === e ? e : "unknown failure: #{e.inspect}")
rescue ArgumentError # If we get an ArgumentError error, then the exec was successful
  true
ensure
  child_process_status.close
  open_pipes.delete(child_process_status)
end