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
This commit is contained in:
Shawn Best
2014-11-05 00:58:55 +00:00
parent 65ec83b09f
commit 629680e499

View File

@@ -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);