kill: report error if cannot kill process

Shell kill would report a problem if you tried to kill a process
while procps kill was silent. This meant it looked like kill worked
when it actually failed.

References:
 commit 07642b8ea6
 https://bugs.debian.org/733172
This commit is contained in:
Craig Small
2016-07-02 14:49:51 +10:00
parent a2c79b6237
commit 5e9c522eea
2 changed files with 2 additions and 0 deletions

1
kill.c
View File

@ -132,6 +132,7 @@ int main(int argc, char **argv)
pid = strtol_or_err(argv[i], _("failed to parse argument"));
if (!kill((pid_t) pid, signo))
continue;
error(0, errno, "(%d)", pid);
exitvalue = EXIT_FAILURE;
continue;
}