Chromium Code Reviews| Index: runtime/bin/process_macos.cc |
| diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc |
| index 9a1d178864d969416f65c13f7c5bb362f323e9c1..0fc3ef5223be27f7eee9c29338f9282736fe507d 100644 |
| --- a/runtime/bin/process_macos.cc |
| +++ b/runtime/bin/process_macos.cc |
| @@ -52,7 +52,7 @@ static ProcessInfo* LookupProcess(pid_t pid) { |
| } |
| -static ProcessInfo* RemoveProcess(pid_t pid) { |
| +static void RemoveProcess(pid_t pid) { |
| ProcessInfo* prev = NULL; |
| ProcessInfo* current = active_processes; |
| while (current != NULL) { |
| @@ -62,12 +62,12 @@ static ProcessInfo* RemoveProcess(pid_t pid) { |
| } else { |
| prev->set_next(current->next()); |
| } |
| - return current; |
| + delete current; |
| + return; |
| } |
| prev = current; |
| current = current->next(); |
| } |
| - return NULL; |
| } |
| @@ -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
Ditto.
Mads Ager (google)
2011/11/29 10:10:13
Done.
|
| + 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)); |