module Mixlib::ShellOut::Unix

def configure_subprocess_file_descriptors

exec, the new program will know it's never getting input ever.
reader side of the error marshaling side channel. Close STDIN so when we
replace stdout, and stderr with pipes to the parent, and close the
def configure_subprocess_file_descriptors
  process_status_pipe.first.close
  # HACK: for some reason, just STDIN.close isn't good enough when running
  # under ruby 1.9.2, so make it good enough:
  stdin_reader, stdin_writer = IO.pipe
  stdin_writer.close
  STDIN.reopen stdin_reader
  stdin_reader.close
  stdout_pipe.first.close
  STDOUT.reopen stdout_pipe.last
  stdout_pipe.last.close
  stderr_pipe.first.close
  STDERR.reopen stderr_pipe.last
  stderr_pipe.last.close
  STDOUT.sync = STDERR.sync = true
end