summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
diff options
context:
space:
mode:
authorShawn Best <sbest@blueshiftinc.com>2014-11-05 00:58:55 +0000
committerShawn Best <sbest@blueshiftinc.com>2014-11-05 00:58:55 +0000
commit629680e499c5df3f8965bfbc5b6100261dce0f5a (patch)
treeab670e1a00f741a7e6f207a634c7999dc7234a41 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
parent65ec83b09fe7435899dd0ed822363c104eaab3b8 (diff)
downloadbcm5719-llvm-629680e499c5df3f8965bfbc5b6100261dce0f5a.tar.gz
bcm5719-llvm-629680e499c5df3f8965bfbc5b6100261dce0f5a.zip
for Oleksiy Vyalov - Redirect stdin, stdout and stderr to /dev/null when launching LLGS process. Differential Revision: http://reviews.llvm.org/D6105
llvm-svn: 221324
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 422096ba355..032d74cbbe0 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -863,11 +863,15 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname,
}
} while (has_env_var);
- // Close STDIN, STDOUT and STDERR. We might need to redirect them
- // to "/dev/null" if we run into any problems.
+ // Close STDIN, STDOUT and STDERR.
launch_info.AppendCloseFileAction (STDIN_FILENO);
launch_info.AppendCloseFileAction (STDOUT_FILENO);
launch_info.AppendCloseFileAction (STDERR_FILENO);
+
+ // Redirect STDIN, STDOUT and STDERR to "/dev/null".
+ launch_info.AppendSuppressFileAction (STDIN_FILENO, true, false);
+ launch_info.AppendSuppressFileAction (STDOUT_FILENO, false, true);
+ launch_info.AppendSuppressFileAction (STDERR_FILENO, false, true);
error = Host::LaunchProcess(launch_info);
OpenPOWER on IntegriCloud