diff options
author | bruening@chromium.org <bruening@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-23 17:35:14 +0000 |
---|---|---|
committer | bruening@chromium.org <bruening@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-23 17:35:14 +0000 |
commit | aff8b47835f1f9faa471fd23b8db782cdb492ddd (patch) | |
tree | 4bbebd764641059d9ee9830817750fc344304cc1 /base | |
parent | 3fa1e6f635218c2838ad9de205bd8e32df3a9905 (diff) | |
download | chromium_src-aff8b47835f1f9faa471fd23b8db782cdb492ddd.zip chromium_src-aff8b47835f1f9faa471fd23b8db782cdb492ddd.tar.gz chromium_src-aff8b47835f1f9faa471fd23b8db782cdb492ddd.tar.bz2 |
check for successful exit code in WaitForSingleProcess on Windows to
match other platforms.
consequentially, in browser tests, add PROCESS_QUERY_INFORMATION to
the rights requested when opening a child serviceprocess handle so the
exit code can be queried.
BUG=106234
TEST=Ran base_unittests.exe --gtest_filter="ProcessUtilTest.SpawnChild" with the child custom-tweaked to fail and verified that prior to my change (with HEAD) the failure is NOT detected and the test passes; with this change the failure is detected.
Review URL: http://codereview.chromium.org/8964004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118695 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/process_util_win.cc | 8 |
1 files changed, 5 insertions, 3 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, |