Simplify EnsureProcessTerminated() implementations.
https://chromium-review.googlesource.com/c/chromium/src/+/920799
This commit is contained in:
parent
8da2bd43b8
commit
9264a00dfd
1 changed files with 7 additions and 8 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue