Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: base/process/launch_mac.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/launch_fuchsia.cc ('k') | base/process/launch_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/launch_mac.cc
diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc
index ca706b5553ff7ecd8b9c9c9dc798a0ced5dc515f..b8ff49ce1ac856101ba8e451a66ca3154e3dc045 100644
--- a/base/process/launch_mac.cc
+++ b/base/process/launch_mac.cc
@@ -112,21 +112,19 @@ Process LaunchProcessPosixSpawn(const std::vector<std::string>& argv,
// open stdin to /dev/null and inherit stdout and stderr.
bool inherit_stdout = true, inherit_stderr = true;
bool null_stdin = true;
- if (options.fds_to_remap) {
- for (const auto& dup2_pair : *options.fds_to_remap) {
- if (dup2_pair.second == STDIN_FILENO) {
- null_stdin = false;
- } else if (dup2_pair.second == STDOUT_FILENO) {
- inherit_stdout = false;
- } else if (dup2_pair.second == STDERR_FILENO) {
- inherit_stderr = false;
- }
-
- if (dup2_pair.first == dup2_pair.second) {
- file_actions.Inherit(dup2_pair.second);
- } else {
- file_actions.Dup2(dup2_pair.first, dup2_pair.second);
- }
+ for (const auto& dup2_pair : options.fds_to_remap) {
+ if (dup2_pair.second == STDIN_FILENO) {
+ null_stdin = false;
+ } else if (dup2_pair.second == STDOUT_FILENO) {
+ inherit_stdout = false;
+ } else if (dup2_pair.second == STDERR_FILENO) {
+ inherit_stderr = false;
+ }
+
+ if (dup2_pair.first == dup2_pair.second) {
+ file_actions.Inherit(dup2_pair.second);
+ } else {
+ file_actions.Dup2(dup2_pair.first, dup2_pair.second);
}
}
« no previous file with comments | « base/process/launch_fuchsia.cc ('k') | base/process/launch_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698