From 7d64dae54bde70744a9154b8ac1cbb09d03881c9 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 3 Sep 2013 18:43:32 -0500 Subject: Replace for_each_pid_with_name_in_array_perform_callback_function_upon_translated_value() with name_to_pid(), comparing absolute paths or just basename() consistently as spotted by Lukasz Skalski, and adjust callers. --- toys/lsb/pidof.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toys/lsb/pidof.c') diff --git a/toys/lsb/pidof.c b/toys/lsb/pidof.c index 7285b6ae..70582a51 100644 --- a/toys/lsb/pidof.c +++ b/toys/lsb/pidof.c @@ -43,12 +43,12 @@ static int print_pid(pid_t pid, char * name) xprintf("%*s", len+(!toys.exitval), toybuf); toys.exitval = 0; - return !(toys.optflags & FLAG_s); + return toys.optflags & FLAG_s; } void pidof_main(void) { toys.exitval = 1; - for_each_pid_with_name_in(toys.optargs, print_pid); + name_to_pid(toys.optargs, print_pid); if (!toys.exitval) xputc('\n'); } -- cgit v1.2.3