From: Craig Small Date: Sat, 24 Jan 2015 06:11:11 +0000 (+1100) Subject: skill: fix command line with signal X-Git-Tag: v3.3.11~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7610b3128e6ac40a9e14d9238584e79ece06bc96;p=procps-ng skill: fix command line with signal If skill was used with a signal number then it would intepret the command line with last option interpreted twice. This often confused the program so it just would end up killing nothing. So this would work: skill -t pts/0 This would not: skill -9 -t pts/0 The kill path (in the same file) uses the same logic that has been introduced here. References: https://www.freelists.org/post/procps/skill-command-does-not-work-in-debian-7-releases Signed-off-by: Craig Small --- diff --git a/NEWS b/NEWS index 93ddb2cd..55981d44 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ procps-ng-NEXT ---------------- * pgrep: don't crash with -a -w flags. Merge 33, Debian #768190 + * skill: command line with signal number interpreted correctly procps-ng-3.3.10 ---------------- diff --git a/skill.c b/skill.c index 2b1ce2f1..9a19a8bb 100644 --- a/skill.c +++ b/skill.c @@ -588,8 +588,10 @@ static void skillsnice_parse(int argc, prino = snice_prio_option(&argc, argv); else if (program == PROG_SKILL) { signo = skill_sig_option(&argc, argv); - if (-1 < signo) + if (-1 < signo) { sig_or_pri = signo; + argc -= 1; + } } pid_count = 0;