Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/kill ANSIfy, some style improvements. Some parts from #1...



details:   https://anonhg.NetBSD.org/src/rev/9a3e5305c9a4
branches:  trunk
changeset: 513376:9a3e5305c9a4
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sun Jul 29 22:46:36 2001 +0000

description:
ANSIfy, some style improvements. Some parts from #13593 by Petri Koistinen.

diffstat:

 bin/kill/kill.c |  37 ++++++++++++++++---------------------
 1 files changed, 16 insertions(+), 21 deletions(-)

diffs (104 lines):

diff -r 7cc7cc6bd4bf -r 9a3e5305c9a4 bin/kill/kill.c
--- a/bin/kill/kill.c   Sun Jul 29 22:40:57 2001 +0000
+++ b/bin/kill/kill.c   Sun Jul 29 22:46:36 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kill.c,v 1.17 1998/11/04 18:14:15 christos Exp $       */
+/*     $NetBSD: kill.c,v 1.18 2001/07/29 22:46:36 wiz Exp $    */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)kill.c     8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kill.c,v 1.17 1998/11/04 18:14:15 christos Exp $");
+__RCSID("$NetBSD: kill.c,v 1.18 2001/07/29 22:46:36 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -55,16 +55,14 @@
 #include <stdlib.h>
 #include <string.h>
 
-void nosig __P((char *));
-void printsignals __P((FILE *));
-int signame_to_signum __P((char *));
-void usage __P((void));
-int main __P((int, char *[]));
+void nosig(char *);
+void printsignals(FILE *);
+int signame_to_signum(char *);
+void usage(void);
+int main(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");



Home | Main Index | Thread Index | Old Index