* library: don't strip off wchan prefixes (ps & top) Redhat #1322111
* top: add config file support for XDG specification
* pgrep: warn about 15+ char name only if -f not used
+ * pkill: Return 0 only if we can kill process Debian #852758
procps-ng-3.3.12
----------------
-.\" Manual page for pgrep / pkill.
-.\" Licensed under version 2 of the GNU General Public License.
+.\"
.\" Copyright 2000 Kjetil Torgrim Homme
+.\" 2017 Craig Small
+.\"
+.\" This program is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
.\"
-.TH PGREP "1" "March 2015" "procps-ng" "User Commands"
+.TH PGREP "1" "2017-02-04" "procps-ng" "User Commands"
.SH NAME
pgrep, pkill \- look up or signal processes based on name and other attributes
.SH SYNOPSIS
.PD 0
.TP
0
-One or more processes matched the criteria.
+One or more processes matched the criteria. For pkill the process must also
+have been successfully signalled.
.TP
1
-No processes matched.
+No processes matched or none of them could be signalled.
.TP
2
Syntax error in the command line.
procs = select_procs (&num);
if (i_am_pkill) {
int i;
+ int kill_count = 0;
for (i = 0; i < num; i++) {
if (kill (procs[i].num, opt_signal) != -1) {
if (opt_echo)
printf(_("%s killed (pid %lu)\n"), procs[i].str, procs[i].num);
+ kill_count++;
continue;
}
if (errno==ESRCH)
}
if (opt_count)
fprintf(stdout, "%d\n", num);
+ return !kill_count;
} else {
if (opt_count) {
fprintf(stdout, "%d\n", num);