From a7b8b772dee4f159028e3b998454d7466fbbc88f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 11 Jul 2019 14:00:07 -0700 Subject: 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. --- toys/lsb/killall.c | 2 +- toys/lsb/pidof.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'toys/lsb') 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