diff options
| author | Zachary Turner <zturner@google.com> | 2015-10-14 21:37:36 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2015-10-14 21:37:36 +0000 |
| commit | 4eff2d3177caa7ddbe901d54619f483ed4323e1b (patch) | |
| tree | 15dc969266976323f8766a1bf893b3de750f04c8 /lldb/source/Plugins | |
| parent | efc23de4dd6b9066d83742c7e307067824ced69a (diff) | |
| download | bcm5719-llvm-4eff2d3177caa7ddbe901d54619f483ed4323e1b.tar.gz bcm5719-llvm-4eff2d3177caa7ddbe901d54619f483ed4323e1b.zip | |
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
Diffstat (limited to 'lldb/source/Plugins')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 7 | ||||
| -rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 960730b32b7..84dc10a5afc 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -40,6 +40,7 @@ #include "lldb/Core/Timer.h" #include "lldb/Core/Value.h" #include "lldb/DataFormatters/FormatManager.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/HostThread.h" #include "lldb/Host/StringConvert.h" #include "lldb/Host/Symbols.h" @@ -1004,11 +1005,11 @@ ProcessGDBRemote::DoLaunch (Module *exe_module, ProcessLaunchInfo &launch_info) { // set to /dev/null unless redirected to a file above if (!stdin_file_spec) - stdin_file_spec.SetFile("/dev/null", false); + stdin_file_spec.SetFile(FileSystem::DEV_NULL, false); if (!stdout_file_spec) - stdout_file_spec.SetFile("/dev/null", false); + stdout_file_spec.SetFile(FileSystem::DEV_NULL, false); if (!stderr_file_spec) - stderr_file_spec.SetFile("/dev/null", false); + stderr_file_spec.SetFile(FileSystem::DEV_NULL, false); } else if (platform_sp && platform_sp->IsHost()) { 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; } |

