Merge "Fix race condition between restart and stop/reset."
am: ee14225e0d
Change-Id: Ia49e967f5fb7fc58058c260fcad4559b2a4df15d
This commit is contained in:
commit
5c5a6bdc87
1 changed files with 7 additions and 0 deletions
|
|
@ -960,6 +960,13 @@ void Service::StopOrReset(int how) {
|
|||
} else {
|
||||
flags_ |= how;
|
||||
}
|
||||
// Make sure it's in right status when a restart immediately follow a
|
||||
// stop/reset or vice versa.
|
||||
if (how == SVC_RESTART) {
|
||||
flags_ &= (~(SVC_DISABLED | SVC_RESET));
|
||||
} else {
|
||||
flags_ &= (~SVC_RESTART);
|
||||
}
|
||||
|
||||
if (pid_) {
|
||||
KillProcessGroup(SIGKILL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue