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
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 960730b..84dc10a 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 @@
{
// 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())
{