pgrep: make --terminal respect other criteria
In some cases the --terminal option to pgrep will cause all processes matching the terminal to be output, even if other criteria would exclude them. Specifically, I noticed that it overrides the --runstates option. Signed-off-by: Craig Small <csmall@dropbear.xyz>
This commit is contained in:
@@ -706,8 +706,8 @@ static struct el * select_procs (int *num)
|
||||
match = 0;
|
||||
else if (opt_older && (int)PIDS_GETFLT(ELAPSED) < opt_older)
|
||||
match = 0;
|
||||
else if (opt_term)
|
||||
match = match_strlist(PIDS_GETSTR(TTYNAME), opt_term);
|
||||
else if (opt_term && ! match_strlist(PIDS_GETSTR(TTYNAME), opt_term))
|
||||
match = 0;
|
||||
else if (opt_runstates && ! strchr(opt_runstates, PIDS_GETSCH(STA)))
|
||||
match = 0;
|
||||
else if (opt_cgroup && ! match_cgroup_list (PIDS_GETSTV(CGROUP), opt_cgroup))
|
||||
|
||||
Reference in New Issue
Block a user