pkill should be quiet about processes that have gone away
This commit is contained in:
parent
92ba425ed6
commit
d89cf44470
1
NEWS
1
NEWS
@ -6,6 +6,7 @@ pwdx: new command -- thanks Nicholas Miell
|
|||||||
ps: more room for some columns
|
ps: more room for some columns
|
||||||
watch: passes COLUMNS and LINES in environment
|
watch: passes COLUMNS and LINES in environment
|
||||||
top: in batch mode, tolerate unknown $TERM -- thanks Daniel Walsh
|
top: in batch mode, tolerate unknown $TERM -- thanks Daniel Walsh
|
||||||
|
pkill: quiet about processes that die before kill()
|
||||||
|
|
||||||
procps-3.2.2 --> procps-3.2.3
|
procps-3.2.2 --> procps-3.2.3
|
||||||
|
|
||||||
|
7
pgrep.c
7
pgrep.c
@ -614,9 +614,10 @@ main (int argc, char **argv)
|
|||||||
if (i_am_pkill) {
|
if (i_am_pkill) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 1; i <= procs[0].num; i++) {
|
for (i = 1; i <= procs[0].num; i++) {
|
||||||
if (kill (procs[i].num, opt_signal) == -1)
|
if (kill (procs[i].num, opt_signal) != -1) continue;
|
||||||
fprintf (stderr, "pkill: %ld - %s\n",
|
if (errno==ESRCH) continue; // gone now, which is OK
|
||||||
procs[i].num, strerror (errno));
|
fprintf (stderr, "pkill: %ld - %s\n",
|
||||||
|
procs[i].num, strerror (errno));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (opt_long)
|
if (opt_long)
|
||||||
|
Loading…
Reference in New Issue
Block a user