busybox/procps
Denys Vlasenko 4ee218a2d2 pgrep/pkill: fix -x to also match comm field
When running `pgrep -x example` against a process `/bin/example --arg`,
BusyBox fails to match, while GNU pgrep succeeds. The reason is that the
comparison is done only against the full argv[0] rather than comm. This
patch changes pgrep -x to also try /proc/[pid]/comm for exact matching.

function                                             old     new   delta
pgrep_main                                           681     670     -11

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-11-08 07:42:34 +01:00
..
Config.src config system: move some options closer to relevalnt tool subdirectories 2021-10-12 13:23:29 +02:00
free.c Update applet size estimates 2023-07-10 17:25:21 +02:00
fuser.c Update applet size estimates 2023-07-10 17:25:21 +02:00
iostat.c Update applet size estimates 2023-07-10 17:25:21 +02:00
Kbuild.src kill: optimizations for single-applet build 2017-01-09 18:46:58 +01:00
kill.c Update applet size estimates 2023-07-10 17:25:21 +02:00
lsof.c Update applet size estimates 2023-07-10 17:25:21 +02:00
mpstat.c Update applet size estimates 2023-07-10 17:25:21 +02:00
nmeter.c Update applet size estimates 2023-07-10 17:25:21 +02:00
pgrep.c pgrep/pkill: fix -x to also match comm field 2025-11-08 07:42:34 +01:00
pidof.c Update applet size estimates 2023-07-10 17:25:21 +02:00
pmap.c top,pmap: speed up /smaps parsing 2025-08-06 14:42:06 +02:00
powertop.c powertop: code shrink 2024-07-13 11:46:15 +02:00
ps.c Update applet size estimates 2023-07-10 17:25:21 +02:00
ps.posix ps: add documentation on POSIX ps 2006-11-05 00:47:38 +00:00
pstree.c Update applet size estimates 2023-07-10 17:25:21 +02:00
pwdx.c Update applet size estimates 2023-07-10 17:25:21 +02:00
smemcap.c Update applet size estimates 2023-07-10 17:25:21 +02:00
sysctl.c Update applet size estimates 2023-07-10 17:25:21 +02:00
top.c libbb: make read_cmdline() replace chars 1..31 with '?', not space 2025-08-06 14:02:05 +02:00
uptime.c Update applet size estimates 2023-07-10 17:25:21 +02:00
watch.c Update applet size estimates 2023-07-10 17:25:21 +02:00