Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee14225e authored by Tao Wu's avatar Tao Wu Committed by Gerrit Code Review
Browse files

Merge "Fix race condition between restart and stop/reset."

parents 7de02203 84b856d9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);