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

Side by Side Diff: tools/gn/exec_process.cc

Issue 924803004: Remove uses of WaitForExitCode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/process/kill.h" 8 #include "base/process/kill.h"
9 #include "base/process/launch.h" 9 #include "base/process/launch.h"
10 #include "base/process/process.h"
10 11
11 #if defined(OS_WIN) 12 #if defined(OS_WIN)
12 #include <windows.h> 13 #include <windows.h>
13 14
14 #include "base/win/scoped_handle.h" 15 #include "base/win/scoped_handle.h"
15 #include "base/win/scoped_process_information.h" 16 #include "base/win/scoped_process_information.h"
16 #endif 17 #endif
17 18
18 #if defined(OS_POSIX) 19 #if defined(OS_POSIX)
19 #include <fcntl.h> 20 #include <fcntl.h>
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 HANDLE_EINTR(select(std::max(out_read.get(), err_read.get()) + 1, 229 HANDLE_EINTR(select(std::max(out_read.get(), err_read.get()) + 1,
229 &read_fds, nullptr, nullptr, nullptr)); 230 &read_fds, nullptr, nullptr, nullptr));
230 if (res <= 0) 231 if (res <= 0)
231 break; 232 break;
232 if (FD_ISSET(out_read.get(), &read_fds)) 233 if (FD_ISSET(out_read.get(), &read_fds))
233 out_open = ReadFromPipe(out_read.get(), std_out); 234 out_open = ReadFromPipe(out_read.get(), std_out);
234 if (FD_ISSET(err_read.get(), &read_fds)) 235 if (FD_ISSET(err_read.get(), &read_fds))
235 err_open = ReadFromPipe(err_read.get(), std_err); 236 err_open = ReadFromPipe(err_read.get(), std_err);
236 } 237 }
237 238
238 return base::WaitForExitCode(pid, exit_code); 239 base::Process process(pid);
240 return process.WaitForExit(exit_code);
239 } 241 }
240 } 242 }
241 243
242 return false; 244 return false;
243 } 245 }
244 #endif 246 #endif
245 247
246 } // namespace internal 248 } // namespace internal
247 249
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698