{
struct maps *maps;
struct process *process;
+ struct pidlist *pidl, *n;
FILE *file;
char path[512];
free:
free(process);
+ /*
+ * Remove the pid from the list. It is no longer an
+ * interesting pid, since we can't access its data
+ */
+ list_for_each_entry_safe(pidl, n, &opts->pidlist, list) {
+ if (pidl->pid == pid) {
+ list_del(&pidl->list);
+ break;
+ }
+ }
+
return 0;
}
int scan_all_pids(struct pageframe *pf, struct process *process_list,
struct parse_opts *opts)
{
- struct pidlist *pidlist;
+ struct pidlist *pidlist, *n;
DIR *dir = NULL;
int pid;
int count = 0;
if (is_parse_option(opts, PARSE_PID)) {
- list_for_each_entry(pidlist, &opts->pidlist, list) {
+ list_for_each_entry_safe(pidlist, n, &opts->pidlist, list) {
count += read_pageframe_with_threads(pidlist->pid, pf,
process_list, opts);
}