Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/pkill Sprinkle const liberally



details:   https://anonhg.NetBSD.org/src/rev/9c829101522e
branches:  trunk
changeset: 583145:9c829101522e
user:      dsainty <dsainty%NetBSD.org@localhost>
date:      Wed Jul 20 12:54:30 2005 +0000

description:
Sprinkle const liberally

diffstat:

 usr.bin/pkill/pkill.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (61 lines):

diff -r 9dae47ff8efa -r 9c829101522e usr.bin/pkill/pkill.c
--- a/usr.bin/pkill/pkill.c     Wed Jul 20 12:40:27 2005 +0000
+++ b/usr.bin/pkill/pkill.c     Wed Jul 20 12:54:30 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pkill.c,v 1.13 2005/07/20 12:40:27 dsainty Exp $       */
+/*     $NetBSD: pkill.c,v 1.14 2005/07/20 12:54:30 dsainty Exp $       */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: pkill.c,v 1.13 2005/07/20 12:40:27 dsainty Exp $");
+__RCSID("$NetBSD: pkill.c,v 1.14 2005/07/20 12:54:30 dsainty Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -109,18 +109,19 @@
 
 int    main(int, char **);
 static void    usage(void) __attribute__((__noreturn__));
-static int     killact(struct kinfo_proc2 *);
-static int     grepact(struct kinfo_proc2 *);
+static int     killact(const struct kinfo_proc2 *);
+static int     grepact(const struct kinfo_proc2 *);
 static void    makelist(struct listhead *, enum listtype, char *);
 
 int
 main(int argc, char **argv)
 {
-       char buf[_POSIX2_LINE_MAX], *mstr, **pargv, *p, *q;
+       char buf[_POSIX2_LINE_MAX], **pargv, *q;
        int i, j, ch, bestidx, rv, criteria;
-       int (*action)(struct kinfo_proc2 *);
-       struct kinfo_proc2 *kp;
+       int (*action)(const struct kinfo_proc2 *);
+       const struct kinfo_proc2 *kp;
        struct list *li;
+       const char *mstr, *p;
        u_int32_t bestsec, bestusec;
        regex_t reg;
        regmatch_t regmatch;
@@ -429,7 +430,7 @@
 }
 
 static int
-killact(struct kinfo_proc2 *kp)
+killact(const struct kinfo_proc2 *kp)
 {
        if (kill(kp->p_pid, signum) == -1) {
 
@@ -450,7 +451,7 @@
 }
 
 static int
-grepact(struct kinfo_proc2 *kp)
+grepact(const struct kinfo_proc2 *kp)
 {
        char **argv;
 



Home | Main Index | Thread Index | Old Index