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

Unified Diff: runtime/bin/process_linux.cc

Issue 8659032: Fix memory leak in MacOS process handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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
Index: runtime/bin/process_linux.cc
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index e82d0d685de9aca4fdf9b063111380dbd70dde41..2351de97809dd23ce3403aa2e108adfadb5819e3 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -230,13 +230,19 @@ int Process::Start(const char* path,
close(read_err[0]);
close(exec_control[0]);
- dup2(write_out[0], STDIN_FILENO);
+ if (dup2(write_out[0], STDIN_FILENO) == -1) {
Søren Gjesse 2011/11/29 09:39:25 As this is in the child process the output of thes
Mads Ager (google) 2011/11/29 10:10:13 Yes, refactored the code after execvp into a Repor
+ perror("Failed to dup stdin");
+ }
close(write_out[0]);
- dup2(read_in[1], STDOUT_FILENO);
+ if (dup2(read_in[1], STDOUT_FILENO) == -1) {
+ perror("Failed to dup stdout");
+ }
close(read_in[1]);
- dup2(read_err[1], STDERR_FILENO);
+ if (dup2(read_err[1], STDERR_FILENO) == -1) {
+ perror("Failed to dup stderr");
+ }
close(read_err[1]);
execvp(path, const_cast<char* const*>(program_arguments));

Powered by Google App Engine
This is Rietveld 408576698