From 28c65da05b29f34f2ed3e35821ad8549eb143e19 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 15 Sep 2010 12:52:19 +1000 Subject: win32: find_pid_by_name: skip argv checks as we do not have that info --- libbb/find_pid_by_name.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libbb/find_pid_by_name.c b/libbb/find_pid_by_name.c index db823d05b..d4bea8ab5 100644 --- a/libbb/find_pid_by_name.c +++ b/libbb/find_pid_by_name.c @@ -56,6 +56,7 @@ static int comm_match(procps_status_t *p, const char *procName) * This can be crazily_long_script_name.sh! * The telltale sign is basename(argv[1]) == procName */ +#if !ENABLE_PLATFORM_MINGW32 if (!p->argv0) return 0; @@ -66,6 +67,7 @@ static int comm_match(procps_status_t *p, const char *procName) if (strcmp(bb_basename(argv1), procName) != 0) return 0; +#endif return 1; } @@ -88,10 +90,12 @@ pid_t* FAST_FUNC find_pid_by_name(const char *procName) pidList = xzalloc(sizeof(*pidList)); while ((p = procps_scan(p, PSSCAN_PID|PSSCAN_COMM|PSSCAN_ARGVN|PSSCAN_EXE))) { if (comm_match(p, procName) +#if !ENABLE_PLATFORM_MINGW32 /* or we require argv0 to match (essential for matching reexeced /proc/self/exe)*/ || (p->argv0 && strcmp(bb_basename(p->argv0), procName) == 0) /* or we require /proc/PID/exe link to match */ || (p->exe && strcmp(bb_basename(p->exe), procName) == 0) +#endif ) { pidList = xrealloc_vector(pidList, 2, i); pidList[i++] = p->pid; -- cgit v1.2.3-55-g6feb