aboutsummaryrefslogtreecommitdiff
path: root/libbb/find_pid_by_name.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/find_pid_by_name.c')
-rw-r--r--libbb/find_pid_by_name.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libbb/find_pid_by_name.c b/libbb/find_pid_by_name.c
index 52debb171..0b6d5a206 100644
--- a/libbb/find_pid_by_name.c
+++ b/libbb/find_pid_by_name.c
@@ -95,7 +95,11 @@ pid_t* FAST_FUNC find_pid_by_name(const char *procName)
95 /* or we require argv0 to match (essential for matching reexeced /proc/self/exe)*/ 95 /* or we require argv0 to match (essential for matching reexeced /proc/self/exe)*/
96 || (p->argv0 && strcmp(bb_basename(p->argv0), procName) == 0) 96 || (p->argv0 && strcmp(bb_basename(p->argv0), procName) == 0)
97 /* or we require /proc/PID/exe link to match */ 97 /* or we require /proc/PID/exe link to match */
98 || (p->exe && strcmp(bb_basename(p->exe), procName) == 0) 98 || (p->exe && strcmp(
99 procName[0] == '/' ? p->exe /* support "pidof /path/to/binary" case too */
100 : bb_basename(p->exe),
101 procName
102 ) == 0)
99#endif 103#endif
100 ) { 104 ) {
101 pidList = xrealloc_vector(pidList, 2, i); 105 pidList = xrealloc_vector(pidList, 2, i);