skill: Restore the -p flag functionality
When the skill program was ported to the new API the code to filter on PID, used by the -p option, was missed. It is now restored. References: https://bugs.debian.org/1025915
This commit is contained in:
parent
31117ae10e
commit
f7a33746f8
4
NEWS
4
NEWS
@ -1,3 +1,7 @@
|
|||||||
|
procps-ng-NEXT
|
||||||
|
---------------
|
||||||
|
* docs: Don't install English manpages twice
|
||||||
|
* skill: Match on -p again Debian #1025915
|
||||||
procps-ng-4.0.2
|
procps-ng-4.0.2
|
||||||
---------------
|
---------------
|
||||||
* library revision - 0:1:0
|
* library revision - 0:1:0
|
||||||
|
@ -287,6 +287,8 @@ static void scan_procs(struct run_time_conf_t *run_time)
|
|||||||
for (i=0; i < total_procs; i++) {
|
for (i=0; i < total_procs; i++) {
|
||||||
if (PIDS_GETINT(PID) == my_pid || PIDS_GETINT(PID) == 0)
|
if (PIDS_GETINT(PID) == my_pid || PIDS_GETINT(PID) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
if (pids && !match_intlist(PIDS_GETINT(PID), pid_count, pids))
|
||||||
|
continue;
|
||||||
if (uids && !match_intlist(PIDS_GETUNT(EUID), uid_count, (int *)uids))
|
if (uids && !match_intlist(PIDS_GETUNT(EUID), uid_count, (int *)uids))
|
||||||
continue;
|
continue;
|
||||||
if (ttys && !match_intlist(PIDS_GETINT(TTY), tty_count, ttys))
|
if (ttys && !match_intlist(PIDS_GETINT(TTY), tty_count, ttys))
|
||||||
|
32
testsuite/skill.test/skill.exp
Normal file
32
testsuite/skill.test/skill.exp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#
|
||||||
|
# Dejagnu testsuite for skill - part of procps
|
||||||
|
#
|
||||||
|
set skill ${topdir}src/skill
|
||||||
|
set tty [ get_tty ]
|
||||||
|
|
||||||
|
if { ![ file exists $skill ] } {
|
||||||
|
untested { skipping (not built)}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
set test "skill with no arguments"
|
||||||
|
spawn $skill
|
||||||
|
expect_pass "$test" "Usage:\\s+\(lt-\)?skill \\\[signal\\\] \\\[options\\\] <expression>"
|
||||||
|
|
||||||
|
set test "skill list signal names"
|
||||||
|
spawn $skill -l
|
||||||
|
expect_pass "$test" "^\(\[A-Z12+-\]\\s*\)+$"
|
||||||
|
|
||||||
|
set test "skill list signal names in table"
|
||||||
|
spawn $skill -L
|
||||||
|
expect_pass "$test" "^\(\\s+\\d+ \[A-Z12+-\]+\)+\\s*$"
|
||||||
|
|
||||||
|
make_testproc
|
||||||
|
|
||||||
|
# Debian 1025915
|
||||||
|
set test "skill find one process"
|
||||||
|
spawn $skill -n -p $testproc1_pid
|
||||||
|
expect_pass "$test" "^$testproc1_pid\\s*$"
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
kill_testproc
|
Loading…
Reference in New Issue
Block a user