Simplify EnsureProcessTerminated() implementations.

https://chromium-review.googlesource.com/c/chromium/src/+/920799
This commit is contained in:
deepak1556 2018-07-22 18:56:57 +05:30 committed by Aleksei Kuzmin
parent 8da2bd43b8
commit 9264a00dfd

View file

@ -32,16 +32,15 @@ bool XDGUtilV(const std::vector<std::string>& argv, const bool wait_for_exit) {
if (!process.IsValid())
return false;
if (!wait_for_exit) {
base::EnsureProcessGetsReaped(process.Pid());
return true;
if (wait_for_exit) {
int exit_code = -1;
if (!process.WaitForExit(&exit_code))
return false;
return (exit_code == 0);
}
int exit_code = -1;
if (!process.WaitForExit(&exit_code))
return false;
return (exit_code == 0);
base::EnsureProcessGetsReaped(std::move(process));
return true;
}
bool XDGUtil(const std::string& util,