]> granicus.if.org Git - psmisc/commitdiff
fuser only kills normal processes, patch thanks to Erik Li SF# 2892724
authorCraig Small <csmall@users.sourceforge.net>
Fri, 13 Nov 2009 02:28:57 +0000 (02:28 +0000)
committerCraig Small <csmall@users.sourceforge.net>
Fri, 13 Nov 2009 02:28:57 +0000 (02:28 +0000)
ChangeLog
src/fuser.c
src/killall.c

index b14b46d7124c001170e4458fee025277d0c0ca2f..e3818b3d5b41fc9fe84adc053ace5045327a3523 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 Changes in 22.9
 ===============
        * short option l returned in fuser Debian #539087
+       * long options terminated with 0s Debian #551833
+       * fuser only kills normal processes, patch thanks to Erik Li SF# 2892724
 
 Changes in 22.8
 ===============
index 0109ff16228c2aaa1c0aeab9d93b328bb9561b70..291b657c2ae5779186016c4434a8419196aecb02 100644 (file)
@@ -808,8 +808,7 @@ int main(int argc, char *argv[])
                {"ipv6", 0, NULL, '6'},
 #endif
                {"SIG", 1, NULL, 'S'},
-
-       
+               { 0, 0, 0, 0 }
        };
 
 #ifdef WITH_IPV6
@@ -1452,11 +1451,13 @@ kill_matched_proc(struct procs *proc_head, const opt_type opts,
        struct procs *pptr;
 
        for (pptr = proc_head; pptr != NULL; pptr = pptr->next) {
-               if ((opts & OPT_INTERACTIVE) && (ask(pptr->pid) == 0))
-                       continue;
-               if (kill(pptr->pid, sig_number) < 0) {
-                       fprintf(stderr, _("Could not kill process %d: %s\n"),
-                               pptr->pid, strerror(errno));
+               if ( pptr->proc_type == PTYPE_NORMAL ){
+                       if ((opts & OPT_INTERACTIVE) && (ask(pptr->pid) == 0))
+                               continue;
+                       if ( kill(pptr->pid, sig_number) < 0) {
+                               fprintf(stderr, _("Could not kill process %d: %s\n"),
+                                               pptr->pid, strerror(errno));
+                       }
                }
 
        }
index 1c87178cf5a7f4e9a99c7f499337d86ec6061cf0..bc4cf153ddf6e6db071a2f4bab654041665bcf46 100644 (file)
@@ -625,9 +625,9 @@ main (int argc, char **argv)
 
   opterr = 0;
 #ifdef WITH_SELINUX
-  while ( (optc = getopt_long_only(argc,argv,"egilqrs:u:vwZ:VI",options,NULL)) != EOF) {
+  while ( (optc = getopt_long_only(argc,argv,"egilqrs:u:vwZ:VI",options,NULL)) != -1) {
 #else
-  while ( (optc = getopt_long_only(argc,argv,"egilqrs:u:vwVI",options,NULL)) != EOF) {
+  while ( (optc = getopt_long_only(argc,argv,"egilqrs:u:vwVI",options,NULL)) != -1) {
 #endif
     switch (optc) {
       case 'e':