forked from OSchip/llvm-project
driver: Map closed standard file descriptors to /dev/null
Utilize Process::FixupStandardFileDescriptors, introduced in r219170, to guard against files from being treated as one of the standard file descriptors. llvm-svn: 219174
This commit is contained in:
parent
35ee87debe
commit
3349872cf3
|
@ -378,6 +378,9 @@ int main(int argc_, const char **argv_) {
|
|||
llvm::sys::PrintStackTraceOnErrorSignal();
|
||||
llvm::PrettyStackTraceProgram X(argc_, argv_);
|
||||
|
||||
if (llvm::sys::Process::FixupStandardFileDescriptors())
|
||||
return 1;
|
||||
|
||||
SmallVector<const char *, 256> argv;
|
||||
llvm::SpecificBumpPtrAllocator<char> ArgAllocator;
|
||||
std::error_code EC = llvm::sys::Process::GetArgumentVector(
|
||||
|
|
Loading…
Reference in New Issue