diff options
-rw-r--r-- | base/process_util_win.cc | 8 | ||||
-rw-r--r-- | chrome/browser/service/service_process_control_browsertest.cc | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/base/process_util_win.cc b/base/process_util_win.cc index dc165ec..19041cc 100644 --- a/base/process_util_win.cc +++ b/base/process_util_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -607,8 +607,10 @@ bool WaitForProcessesToExit(const std::wstring& executable_name, } bool WaitForSingleProcess(ProcessHandle handle, int64 wait_milliseconds) { - bool retval = WaitForSingleObject(handle, wait_milliseconds) == WAIT_OBJECT_0; - return retval; + int exit_code; + if (!WaitForExitCodeWithTimeout(handle, &exit_code, wait_milliseconds)) + return false; + return exit_code == 0; } bool CleanupProcesses(const std::wstring& executable_name, diff --git a/chrome/browser/service/service_process_control_browsertest.cc b/chrome/browser/service/service_process_control_browsertest.cc index 638ec51..714c59a 100644 --- a/chrome/browser/service/service_process_control_browsertest.cc +++ b/chrome/browser/service/service_process_control_browsertest.cc @@ -75,7 +75,9 @@ class ServiceProcessControlBrowserTest EXPECT_NE(static_cast<base::ProcessId>(0), service_pid); EXPECT_TRUE(base::OpenProcessHandleWithAccess( service_pid, - base::kProcessAccessWaitForTermination, + base::kProcessAccessWaitForTermination | + // we need query permission to get exit code + base::kProcessAccessQueryInformation, &service_process_handle_)); // Quit the current message. Post a QuitTask instead of just calling Quit() // because this can get invoked in the context of a Launch() call and we |