Skip to content
Commit 121a174f authored by David Majnemer's avatar David Majnemer
Browse files

Support: Add a utility to remap std{in,out,err} to /dev/null if closed

It's possible to start a program with one (or all) of the standard file
descriptors closed.  Subsequent open system calls will give the program
a low-numbered file descriptor.

This is problematic because we may believe we are writing to standard
out instead of a file.

Introduce Process::FixupStandardFileDescriptors, a helper function to
remap standard file descriptors to /dev/null if they were closed before
the program started.

llvm-svn: 219170
parent a9ae365b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment