Subject: bin/13593: Make bin/kill more stylish.
To: None <gnats-bugs@gnats.netbsd.org>
From: Petri Koistinen <thoron@mb-u04ip041.mbnet.fi>
List: netbsd-bugs
Date: 07/29/2001 22:14:35
>Number:         13593
>Category:       bin
>Synopsis:       Make bin/kill more stylish.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 29 12:10:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Petri Koistinen
>Release:        NetBSD-current 29-Jul-2001
>Organization:
>Environment:
System: NetBSD mb-u04ip041.mbnet.fi 1.5W NetBSD 1.5W (MUURAHAISKEKO) #5: Sat Jul 21 08:56:11 EEST 2001 thoron@legoland:/usr/src/sys/arch/amiga/compile/MUURAHAISKEKO amiga
Architecture: m68k
Machine: amiga
>Description:
	Patch for more stylish bin/kill tool.
>How-To-Repeat:
>Fix:
Index: kill.c
===================================================================
RCS file: /cvsroot/basesrc/bin/kill/kill.c,v
retrieving revision 1.17
diff -u -r1.17 kill.c
--- kill.c	1998/11/04 18:14:15	1.17
+++ kill.c	2001/07/29 19:10:07
@@ -1,4 +1,4 @@
-/*	$NetBSD: kill.c,v 1.17 1998/11/04 18:14:15 christos Exp $	*/
+/* $NetBSD: kill.c,v 1.17 1998/11/04 18:14:15 christos Exp $ */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -51,9 +51,9 @@
 #include <err.h>
 #include <errno.h>
 #include <signal.h>
+#include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 void nosig __P((char *));
 void printsignals __P((FILE *));
@@ -62,9 +62,7 @@
 int main __P((int, char *[]));
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
 	int errors, numsig, pid;
 	char *ep;
@@ -75,15 +73,15 @@
 	numsig = SIGTERM;
 
 	argc--, argv++;
-	if (!strcmp(*argv, "-l")) {
+	if (strcmp(*argv, "-l") == 0) {
 		argc--, argv++;
 		if (argc > 1)
 			usage();
 		if (argc == 1) {
-			if (!isdigit((unsigned char)**argv))
+			if (isdigit((unsigned char)**argv) == 0)
 				usage();
 			numsig = strtol(*argv, &ep, 10);
-			if (*ep)
+			if (*ep != 0)
 				errx(1, "illegal signal number: %s", *argv);
 			if (numsig >= 128)
 				numsig -= 128;
@@ -143,12 +141,11 @@
 }
 
 int
-signame_to_signum(sig)
-	char *sig;
+signame_to_signum(char *sig)
 {
 	int n;
 
-	if (!strncasecmp(sig, "sig", 3))
+	if (strncasecmp(sig, "sig", 3) == 0)
 		sig += 3;
 	for (n = 1; n < NSIG; n++) {
 		if (!strcasecmp(sys_signame[n], sig))
@@ -158,8 +155,7 @@
 }
 
 void
-nosig(name)
-	char *name;
+nosig(char *name)
 {
 
 	warnx("unknown signal %s; valid signals:", name);
@@ -169,8 +165,7 @@
 }
 
 void
-printsignals(fp)
-	FILE *fp;
+printsignals(FILE *fp)
 {
 	int n;
 
@@ -184,7 +179,7 @@
 }
 
 void
-usage()
+usage(void)
 {
 
 	(void)fprintf(stderr, "usage: kill [-s signal_name] pid ...\n");
>Release-Note:
>Audit-Trail:
>Unformatted: