Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/systat WARNS=3



details:   https://anonhg.NetBSD.org/src/rev/fc8fcb4d4716
branches:  trunk
changeset: 574339:fc8fcb4d4716
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Feb 26 22:12:33 2005 +0000

description:
WARNS=3

diffstat:

 usr.bin/systat/Makefile   |   3 ++-
 usr.bin/systat/bufcache.c |  12 +++++-------
 usr.bin/systat/df.c       |   6 +++---
 usr.bin/systat/extern.h   |   6 +++---
 usr.bin/systat/icmp.c     |   5 ++---
 usr.bin/systat/ip.c       |   5 ++---
 usr.bin/systat/ip6.c      |   5 ++---
 usr.bin/systat/ipsec.c    |   5 ++---
 usr.bin/systat/keyboard.c |  13 ++++++++-----
 usr.bin/systat/main.c     |  12 ++++++------
 usr.bin/systat/mbufs.c    |  19 +++++++++----------
 usr.bin/systat/netcmds.c  |  16 ++++++++--------
 usr.bin/systat/netstat.c  |  22 +++++++++++-----------
 usr.bin/systat/pigs.c     |  22 ++++++++++------------
 usr.bin/systat/ps.c       |  45 ++++++++++++++++++++++-----------------------
 usr.bin/systat/swap.c     |  20 ++++++++++----------
 usr.bin/systat/systat.h   |   6 +++---
 usr.bin/systat/tcp.c      |   5 ++---
 usr.bin/systat/vmstat.c   |  43 ++++++++++++++++++++++---------------------
 19 files changed, 132 insertions(+), 138 deletions(-)

diffs (truncated from 952 to 300 lines):

diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/Makefile
--- a/usr.bin/systat/Makefile   Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/Makefile   Sat Feb 26 22:12:33 2005 +0000
@@ -1,9 +1,10 @@
-#      $NetBSD: Makefile,v 1.29 2005/02/16 03:45:41 hubertf Exp $
+#      $NetBSD: Makefile,v 1.30 2005/02/26 22:12:33 dsl Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/6/93
 
 .include <bsd.own.mk>
 
 PROG=  systat
+WARNS=3
 
 .PATH: ${NETBSDSRCDIR}/usr.bin/vmstat ${NETBSDSRCDIR}/usr.bin/who
 
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/bufcache.c
--- a/usr.bin/systat/bufcache.c Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/bufcache.c Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bufcache.c,v 1.18 2004/11/23 03:11:33 simonb Exp $     */
+/*     $NetBSD: bufcache.c,v 1.19 2005/02/26 22:12:33 dsl Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: bufcache.c,v 1.18 2004/11/23 03:11:33 simonb Exp $");
+__RCSID("$NetBSD: bufcache.c,v 1.19 2005/02/26 22:12:33 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -52,9 +52,7 @@
 #include <err.h>
 #include <errno.h>
 #include <inttypes.h>
-#include <kvm.h>
 #include <math.h>
-#include <nlist.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -190,7 +188,7 @@
        for (i = lastrow, ml = LIST_FIRST(&mount_list); ml != NULL;
            i++, ml = LIST_NEXT(ml, ml_entries)) {
 
-               int c = ml->ml_count;
+               int cnt = ml->ml_count;
                double v = ml->ml_valid;
                double s = ml->ml_size;
 
@@ -200,7 +198,7 @@
                            "NULL" : ml->ml_mount.mnt_stat.f_mntonname);
                        wprintw(wnd,
                            "    %6d %3d    %8ld %3.0f    %8ld %3.0f     %3.0f",
-                           c, (100 * c) / nbuf,
+                           cnt, (100 * cnt) / nbuf,
                            (long)(v/1024), 100 * v / bufmem,
                            (long)(s/1024), 100 * s / bufmem,
                            100 * v / s);
@@ -209,7 +207,7 @@
                }
 
                /* Update statistics. */
-               tbuf += c;
+               tbuf += cnt;
                tvalid += v;
                tsize += s;
        }
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/df.c
--- a/usr.bin/systat/df.c       Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/df.c       Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: df.c,v 1.1 2005/02/16 03:45:41 hubertf Exp $   */
+/*     $NetBSD: df.c,v 1.2 2005/02/26 22:12:33 dsl Exp $       */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: df.c,v 1.1 2005/02/16 03:45:41 hubertf Exp $");
+__RCSID("$NetBSD: df.c,v 1.2 2005/02/26 22:12:33 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -51,7 +51,7 @@
 
 static int nfss;
 static struct statvfs *fss;
-static char *nodisplay[] = {"procfs", "kernfs", "null", NULL };
+static const char *nodisplay[] = {"procfs", "kernfs", "null", NULL };
 static int displayall=0;
 
 
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/extern.h
--- a/usr.bin/systat/extern.h   Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/extern.h   Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.35 2005/02/16 03:45:41 hubertf Exp $      */
+/*     $NetBSD: extern.h,v 1.36 2005/02/26 22:12:33 dsl Exp $  */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,14 +42,14 @@
 extern struct  mode modes[];
 extern struct  text *xtext;
 extern WINDOW  *wnd;
-extern char    c, *namp, hostname[];
+extern char    *namp, hostname[];
 extern double  avenrun[3];
 extern float   *dk_mspw;
 extern kvm_t   *kd;
 extern long    ntext, textp;
 extern int     CMDLINE;
 extern int     hz, stathz, maxslp;
-extern int     naptime, col;
+extern int     naptime;
 extern int     nhosts;
 extern int     nports;
 extern int     protos;
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/icmp.c
--- a/usr.bin/systat/icmp.c     Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/icmp.c     Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp.c,v 1.7 2003/02/24 10:10:00 dsl Exp $     */
+/*     $NetBSD: icmp.c,v 1.8 2005/02/26 22:12:33 dsl Exp $     */
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran <ad%NetBSD.org@localhost>
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: icmp.c,v 1.7 2003/02/24 10:10:00 dsl Exp $");
+__RCSID("$NetBSD: icmp.c,v 1.8 2005/02/26 22:12:33 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -40,7 +40,6 @@
 #include <netinet/ip_icmp.h>
 #include <netinet/icmp_var.h>
 
-#include <kvm.h>
 #include <string.h>
 
 #include "systat.h"
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/ip.c
--- a/usr.bin/systat/ip.c       Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/ip.c       Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip.c,v 1.11 2003/02/24 10:10:00 dsl Exp $      */
+/*     $NetBSD: ip.c,v 1.12 2005/02/26 22:12:33 dsl Exp $      */
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran <ad%NetBSD.org@localhost>
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ip.c,v 1.11 2003/02/24 10:10:00 dsl Exp $");
+__RCSID("$NetBSD: ip.c,v 1.12 2005/02/26 22:12:33 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -42,7 +42,6 @@
 #include <netinet/udp.h>
 #include <netinet/udp_var.h>
 
-#include <kvm.h>
 #include <string.h>
 
 #include "systat.h"
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/ip6.c
--- a/usr.bin/systat/ip6.c      Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/ip6.c      Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6.c,v 1.10 2003/02/24 10:10:00 dsl Exp $     */
+/*     $NetBSD: ip6.c,v 1.11 2005/02/26 22:12:33 dsl Exp $     */
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran <ad%NetBSD.org@localhost>
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ip6.c,v 1.10 2003/02/24 10:10:00 dsl Exp $");
+__RCSID("$NetBSD: ip6.c,v 1.11 2005/02/26 22:12:33 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -40,7 +40,6 @@
 #include <netinet/ip6.h>
 #include <netinet6/ip6_var.h>
 
-#include <kvm.h>
 #include <string.h>
 
 #include "systat.h"
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/ipsec.c
--- a/usr.bin/systat/ipsec.c    Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/ipsec.c    Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec.c,v 1.7 2003/02/24 10:10:00 dsl Exp $    */
+/*     $NetBSD: ipsec.c,v 1.8 2005/02/26 22:12:33 dsl Exp $    */
 
 /*
  * Copyright (c) 1999, 2000 Andrew Doran <ad%NetBSD.org@localhost>
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ipsec.c,v 1.7 2003/02/24 10:10:00 dsl Exp $");
+__RCSID("$NetBSD: ipsec.c,v 1.8 2005/02/26 22:12:33 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -37,7 +37,6 @@
 #include <netinet/in.h>
 #include <netinet6/ipsec.h>
 
-#include <kvm.h>
 #include <string.h>
 
 #include "systat.h"
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/keyboard.c
--- a/usr.bin/systat/keyboard.c Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/keyboard.c Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: keyboard.c,v 1.21 2005/02/26 19:01:09 dsl Exp $        */
+/*     $NetBSD: keyboard.c,v 1.22 2005/02/26 22:12:33 dsl Exp $        */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: keyboard.c,v 1.21 2005/02/26 19:01:09 dsl Exp $");
+__RCSID("$NetBSD: keyboard.c,v 1.22 2005/02/26 22:12:33 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -43,6 +43,7 @@
 #include <signal.h>
 #include <termios.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "systat.h"
 #include "extern.h"
@@ -50,9 +51,11 @@
 void
 keyboard(void)
 {
-       int ch, rch;
+       int ch, rch, col;
        char *line;
        int i, linesz;
+       static char help[] = "help";
+       static char quit[] = "quit";
 
        linesz = COLS - 2;              /* XXX does not get updated on SIGWINCH */
        if ((line = malloc(linesz)) == NULL) {
@@ -93,12 +96,12 @@
                                    case '?':
                                    case 'H':
                                    case 'h':
-                                       command("help");
+                                       command(help);
                                        move(CMDLINE, 0);
                                        break;
                                    case 'Q':
                                    case 'q':
-                                       command("quit");
+                                       command(quit);
                                        break;
                                    case ':':
                                        move(CMDLINE, 0);
diff -r a7d71c18e3ed -r fc8fcb4d4716 usr.bin/systat/main.c
--- a/usr.bin/systat/main.c     Sat Feb 26 22:11:06 2005 +0000
+++ b/usr.bin/systat/main.c     Sat Feb 26 22:12:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.38 2004/11/04 07:18:47 dsl Exp $    */
+/*     $NetBSD: main.c,v 1.39 2005/02/26 22:12:33 dsl Exp $    */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: main.c,v 1.38 2004/11/04 07:18:47 dsl Exp $");
+__RCSID("$NetBSD: main.c,v 1.39 2005/02/26 22:12:33 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -371,7 +371,7 @@



Home | Main Index | Thread Index | Old Index