OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/cocoa/authorization_util.h" | 5 #include "chrome/browser/cocoa/authorization_util.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 #include <sys/wait.h> | 8 #include <sys/wait.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // local version. | 160 // local version. |
161 int local_exit_status; | 161 int local_exit_status; |
162 int* exit_status_pointer; | 162 int* exit_status_pointer; |
163 if (exit_status) { | 163 if (exit_status) { |
164 exit_status_pointer = exit_status; | 164 exit_status_pointer = exit_status; |
165 } else { | 165 } else { |
166 exit_status_pointer = &local_exit_status; | 166 exit_status_pointer = &local_exit_status; |
167 } | 167 } |
168 | 168 |
169 if (pid != -1) { | 169 if (pid != -1) { |
170 pid_t wait_result; | 170 pid_t wait_result = HANDLE_EINTR(waitpid(pid, exit_status_pointer, 0)); |
171 HANDLE_EINTR(wait_result = waitpid(pid, exit_status_pointer, 0)); | |
172 if (wait_result != pid) { | 171 if (wait_result != pid) { |
173 PLOG(ERROR) << "waitpid"; | 172 PLOG(ERROR) << "waitpid"; |
174 *exit_status_pointer = -1; | 173 *exit_status_pointer = -1; |
175 } | 174 } |
176 } else { | 175 } else { |
177 *exit_status_pointer = -1; | 176 *exit_status_pointer = -1; |
178 } | 177 } |
179 | 178 |
180 return status; | 179 return status; |
181 } | 180 } |
182 | 181 |
183 } // namespace authorization_util | 182 } // namespace authorization_util |
OLD | NEW |