Skip to content

Commit b6daa27

Browse files
Addressed comments
1 parent 4a9ff1d commit b6daa27

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

lldb/source/Host/aix/Host.cpp

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -50,50 +50,7 @@ static bool GetProcessAndStatInfo(::pid_t pid,
5050

5151
uint32_t Host::FindProcessesImpl(const ProcessInstanceInfoMatch &match_info,
5252
ProcessInstanceInfoList &process_infos) {
53-
static const char procdir[] = "/proc/";
54-
55-
DIR *dirproc = opendir(procdir);
56-
if (dirproc) {
57-
struct dirent *direntry = nullptr;
58-
const uid_t our_uid = getuid();
59-
const lldb::pid_t our_pid = getpid();
60-
bool all_users = match_info.GetMatchAllUsers();
61-
62-
while ((direntry = readdir(dirproc)) != nullptr) {
63-
64-
lldb::pid_t pid = atoi(direntry->d_name);
65-
66-
// Skip this process.
67-
if (pid == our_pid)
68-
continue;
69-
70-
::pid_t tracerpid;
71-
ProcessState State;
72-
ProcessInstanceInfo process_info;
73-
74-
if (!GetProcessAndStatInfo(pid, process_info, State, tracerpid))
75-
continue;
76-
77-
// Skip if process is being debugged.
78-
if (tracerpid != 0)
79-
continue;
80-
81-
if (State == ProcessState::Zombie)
82-
continue;
83-
84-
// Check for user match if we're not matching all users and not running
85-
// as root.
86-
if (!all_users && (our_uid != 0) && (process_info.GetUserID() != our_uid))
87-
continue;
88-
89-
if (match_info.Matches(process_info))
90-
process_infos.push_back(process_info);
91-
}
92-
93-
closedir(dirproc);
94-
}
95-
96-
return process_infos.size();
53+
return 0;
9754
}
9855

9956
bool Host::GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info) {

0 commit comments

Comments
 (0)