From 4eff2d3177caa7ddbe901d54619f483ed4323e1b Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 14 Oct 2015 21:37:36 +0000 Subject: Make uses of /dev/null portable across OSes. Most platforms have "/dev/null". Windows has "nul". Instead of hardcoding the string /dev/null at various places, make a constant that contains the correct value depending on the platform, and use that everywhere instead. llvm-svn: 250331 --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 704e851e72c..1b8e43dabd8 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -34,6 +34,7 @@ #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/Host/ConnectionFileDescriptor.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/Pipe.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -809,9 +810,9 @@ ScriptInterpreterPython::ExecuteOneLine (const char *command, CommandReturnObjec else { input_file_sp.reset (new StreamFile ()); - input_file_sp->GetFile().Open("/dev/null", File::eOpenOptionRead); + input_file_sp->GetFile().Open(FileSystem::DEV_NULL, File::eOpenOptionRead); output_file_sp.reset (new StreamFile ()); - output_file_sp->GetFile().Open("/dev/null", File::eOpenOptionWrite); + output_file_sp->GetFile().Open(FileSystem::DEV_NULL, File::eOpenOptionWrite); error_file_sp = output_file_sp; } -- cgit v1.2.3