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

Commit e6ec2661 authored by William Roberts's avatar William Roberts
Browse files

init: fix errno handling on KillProcessGroup



KillProcessGroup can return -1 without errno set, which produces error
messages like this:

init: Sending signal 15 to service 'vold' (pid 1806) process group...
init: failed to kill 2 processes for processgroup 1806
init: killProcessGroup(0, 1806, 15) failed: Success

Test: boot and reboot hikey.

Change-Id: I51f242da234daee84795a3fbdffe9ad1f4567140
Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
parent 9401a0b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ void Service::KillProcessGroup(int signal) {
        r = killProcessGroup(uid_, pid_, signal);
    }
    if (r == -1) {
        PLOG(ERROR) << "killProcessGroup(" << uid_ << ", " << pid_ << ", " << signal << ") failed";
        LOG(ERROR) << "killProcessGroup(" << uid_ << ", " << pid_ << ", " << signal << ") failed";
    }
    if (kill(-pid_, signal) == -1) {
        PLOG(ERROR) << "kill(" << pid_ << ", " << signal << ") failed";