From: Jim Warner Date: Sun, 9 Oct 2011 00:02:58 +0000 (-0500) Subject: libtool accommodation: kill, skill, snice X-Git-Tag: v3.3.0~7^2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9ae59f5dfec00a1dc5f8e5c4354eb523113434c;p=procps-ng libtool accommodation: kill, skill, snice --- diff --git a/skill.c b/skill.c index 96cc386e..1aa1a54d 100644 --- a/skill.c +++ b/skill.c @@ -46,8 +46,7 @@ static int saved_argc; static int sig_or_pri; -static int program; -#define PROG_GARBAGE 0 /* keep this 0 */ +static int program = -1; #define PROG_KILL 1 #define PROG_SKILL 2 /* #define PROG_NICE 3 */ /* easy, but the old one isn't broken */ @@ -558,17 +557,13 @@ int main(int argc, const char *argv[]){ tmpstr=strrchr(*argv,'/'); if(tmpstr) tmpstr++; if(!tmpstr) tmpstr=*argv; - program = PROG_GARBAGE; - if(*tmpstr=='s'){ - setpriority(PRIO_PROCESS,my_pid,-20); - if(!strcmp(tmpstr,"snice")) program = PROG_SNICE; - if(!strcmp(tmpstr,"skill")) program = PROG_SKILL; - }else{ - if(!strcmp(tmpstr,"kill")) program = PROG_KILL; - } + if(strstr(tmpstr,"kill")) program = PROG_KILL; + if(strstr(tmpstr,"skill")) program = PROG_SKILL; + if(strstr(tmpstr,"snice")) program = PROG_SNICE; switch(program){ case PROG_SNICE: case PROG_SKILL: + setpriority(PRIO_PROCESS,my_pid,-20); skillsnice_parse(argc, argv); /* show_lists(); */ iterate(); /* this is it, go get them */