aboutsummaryrefslogtreecommitdiff
path: root/toys/lsb/killall.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-07-11 14:00:07 -0700
committerRob Landley <rob@landley.net>2019-07-12 13:18:11 -0500
commita7b8b772dee4f159028e3b998454d7466fbbc88f (patch)
treef8cdf969a4a42ff39bad63e5d3a7aaf4844cb541 /toys/lsb/killall.c
parent5194d4ad66ad130cb730e0b192ba1e2b5181184d (diff)
downloadtoybox-a7b8b772dee4f159028e3b998454d7466fbbc88f.tar.gz
pidof: fix default behavior, add -x.
Before this patch, we're effectively doing `pidof -x` all the time. This patch changes names_to_pid() to allow us to say whether or not we want to include scripts, and adjusts the callers appropriately. Also add tests for `pidof` versus `pidof -x` which pass after this patch, without regressing the existing killall tests.
Diffstat (limited to 'toys/lsb/killall.c')
-rw-r--r--toys/lsb/killall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/lsb/killall.c b/toys/lsb/killall.c
index 47aea23d..c81360b1 100644
--- a/toys/lsb/killall.c
+++ b/toys/lsb/killall.c
@@ -89,7 +89,7 @@ void killall_main(void)
TT.err = xmalloc(2*toys.optc);
for (i=0; i<toys.optc; i++) TT.err[i] = ESRCH;
- names_to_pid(TT.names, kill_process);
+ names_to_pid(TT.names, kill_process, 1);
for (i=0; i<toys.optc; i++) {
if (TT.err[i]) {
toys.exitval = 1;