Chromium Code Reviews| 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)); |