r219174 - driver: Map closed standard file descriptors to /dev/null
David Majnemer
david.majnemer at gmail.com
Mon Oct 6 16:52:23 PDT 2014
Author: majnemer
Date: Mon Oct 6 18:52:23 2014
New Revision: 219174
URL: http://llvm.org/viewvc/llvm-project?rev=219174&view=rev
Log:
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.
Modified:
cfe/trunk/tools/driver/driver.cpp
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=219174&r1=219173&r2=219174&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Mon Oct 6 18:52:23 2014
@@ -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(
More information about the cfe-commits
mailing list