diff options
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/util.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 5511b27c9726..43ec2b9f3be8 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -492,20 +492,19 @@ void Pid::kill() { if (pid == -1) return; - printMsg(lvlError, format("killing child process %1%") % pid); + printMsg(lvlError, format("killing process %1%") % pid); /* Send a KILL signal to the child. If it has its own process group, send the signal to every process in the child process group (which hopefully includes *all* its children). */ if (::kill(separatePG ? -pid : pid, SIGKILL) != 0) - printMsg(lvlError, format("killing process %1%") % pid); - else { - /* Wait until the child dies, disregarding the exit status. */ - int status; - while (waitpid(pid, &status, 0) == -1) - if (errno != EINTR) printMsg(lvlError, - format("waiting for process %1%") % pid); - } + printMsg(lvlError, (SysError(format("killing process %1%") % pid).msg())); + + /* Wait until the child dies, disregarding the exit status. */ + int status; + while (waitpid(pid, &status, 0) == -1) + if (errno != EINTR) printMsg(lvlError, + (SysError(format("waiting for process %1%") % pid).msg())); pid = -1; } |