Author: csjp
Date: Fri Jan 17 04:16:39 2014
New Revision: 260801
URL: http://svnweb.freebsd.org/changeset/base/260801

Log:
  Re-work r260800 to include other signals which start with 'I'
  such as ILL, INFO etc..
  
  Submitted by: delphij
  MFC after:    2 weeks

Modified:
  head/usr.bin/killall/killall.c

Modified: head/usr.bin/killall/killall.c
==============================================================================
--- head/usr.bin/killall/killall.c      Fri Jan 17 03:30:24 2014        
(r260800)
+++ head/usr.bin/killall/killall.c      Fri Jan 17 04:16:39 2014        
(r260801)
@@ -90,6 +90,7 @@ nosig(char *name)
 int
 main(int ac, char **av)
 {
+       char            **saved_av;
        struct kinfo_proc *procs, *newprocs;
        struct stat     sb;
        struct passwd   *pw;
@@ -210,16 +211,8 @@ main(int ac, char **av)
                        case 'z':
                                zflag++;
                                break;
-                       case 'I':
-                               /*
-                                * NB: do not confuse -INT with -I
-                                */
-                               if (strncmp(*av, "INT", 3) != 0) {
-                                       Iflag = 1;
-                                       break;
-                               }
-                               /* FALLTHROUGH */
                        default:
+                               saved_av = av;
                                if (isalpha((unsigned char)**av)) {
                                        if (strncasecmp(*av, "SIG", 3) == 0)
                                                *av += 3;
@@ -229,8 +222,14 @@ main(int ac, char **av)
                                                        sig = p - sys_signame;
                                                        break;
                                                }
-                                       if (!sig)
-                                               nosig(*av);
+                                       if (!sig) {
+                                               if (**saved_av == 'I') {
+                                                       av = saved_av;
+                                                       Iflag = 1;
+                                                       break;
+                                               } else
+                                                       nosig(*av);
+                                       }
                                } else if (isdigit((unsigned char)**av)) {
                                        sig = strtol(*av, &ep, 10);
                                        if (!*av || *ep)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to