tags 331419 + patch
thanks

Package: procps
Version: 3.2.7-3

Third problem:
--------------
[EMAIL PROTECTED] snice -v -p 25857 -p 25861 -p 26292 -p 26293 +20
[EMAIL PROTECTED]

The -v flag is apparently ignored.

I had tried the -v flag at the end, which works fine.

For the case where -v is not at the end, a patch is attached.

In skill.c, there is a function called skillsnice_parse().  The switch
statement did not have a "break" at the end of each case, so the "-p"
option would fall into the next case, which was "-c".  In the "-c"
case, it called a macro, ENLIST(cmd,argptr), which allocated an array
called cmds.  The function check_proc() would check to see if cmds was
set, do some stuff and skip over the hurt_proc() function, which did
the work.

I think the patch is correct, but please test thoroughly.  The binary
file called /usr/bin/skill is symlink'd to /bin/kill and
/usr/bin/snice.
--- skill.c	2007-05-04 14:10:06.000000000 -0700
+++ skillFIX.c	2007-05-04 14:35:04.000000000 -0700
@@ -454,7 +454,9 @@
     num_found = 0; /* we should find at least one thing */
     switch(force){ /* fall through each data type */
     default: skillsnice_usage();
+      break;
     case 0: /* not forced */
+      break;
     case 't':
       if(argc){
         struct stat sbuf;
@@ -478,6 +480,7 @@
         }
       }
       if(force) continue;
+      break;
     case 'u':
       if(argc){
         struct passwd *passwd_data;
@@ -489,6 +492,7 @@
         }
       }
       if(force) continue;
+      break;
     case 'p':
       if(argc && *argptr>='0' && *argptr<='9'){
         char *endp;
@@ -502,12 +506,14 @@
       }
       if(force) continue;
       if(num_found) continue; /* could still be an option */
+      break;
     case 'c':
       if(argc){
         num_found++;
         ENLIST(cmd,argptr);
         if(!NEXTARG) break;
       }
+      break;
     } /* END OF SWITCH */
   } /* END OF WHILE */
   /* No more arguments to process. Must sanity check. */

Reply via email to