diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-06-23 22:21:50 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-06-23 22:21:50 +0000 |
commit | dfeead84e5b3e2b349a06703fdb4ba9cafb2ab94 (patch) | |
tree | f0412471d516ae339a59982ce32158d3789aed53 /usr.bin | |
parent | f117bcdcb3d1667b3f1b0eda5c6389ba8dce21da (diff) |
Cleanup by Theo and myself. CMDLINE changed to long to make
command line work on 64bit platforms. This is somewhat bogus
and is really just a temporary workaround (there may be a curses bug).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/systat/cmds.c | 6 | ||||
-rw-r--r-- | usr.bin/systat/disks.c | 5 | ||||
-rw-r--r-- | usr.bin/systat/extern.h | 4 | ||||
-rw-r--r-- | usr.bin/systat/iostat.c | 6 | ||||
-rw-r--r-- | usr.bin/systat/main.c | 10 | ||||
-rw-r--r-- | usr.bin/systat/netcmds.c | 8 | ||||
-rw-r--r-- | usr.bin/systat/netstat.c | 5 | ||||
-rw-r--r-- | usr.bin/systat/pigs.c | 6 | ||||
-rw-r--r-- | usr.bin/systat/swap.c | 9 | ||||
-rw-r--r-- | usr.bin/systat/systat.h | 20 |
10 files changed, 42 insertions, 37 deletions
diff --git a/usr.bin/systat/cmds.c b/usr.bin/systat/cmds.c index c57904645df..6804c4c981a 100644 --- a/usr.bin/systat/cmds.c +++ b/usr.bin/systat/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.4 1996/06/26 05:40:04 deraadt Exp $ */ +/* $OpenBSD: cmds.c,v 1.5 1997/06/23 22:21:45 millert Exp $ */ /* $NetBSD: cmds.c,v 1.4 1996/05/10 23:16:32 thorpej Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95"; #endif -static char rcsid[] = "$OpenBSD: cmds.c,v 1.4 1996/06/26 05:40:04 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: cmds.c,v 1.5 1997/06/23 22:21:45 millert Exp $"; #endif /* not lint */ #include <stdlib.h> @@ -158,7 +158,7 @@ lookup(name) longest = 0; nmatches = 0; found = (struct cmdtab *) 0; - for (c = cmdtab; p = c->c_name; c++) { + for (c = cmdtab; (p = c->c_name); c++) { for (q = name; *q == *p++; q++) if (*q == 0) /* exact match? */ return (c); diff --git a/usr.bin/systat/disks.c b/usr.bin/systat/disks.c index a4cfe6d15cf..bc9509aeed2 100644 --- a/usr.bin/systat/disks.c +++ b/usr.bin/systat/disks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disks.c,v 1.7 1997/01/31 10:08:37 deraadt Exp $ */ +/* $OpenBSD: disks.c,v 1.8 1997/06/23 22:21:46 millert Exp $ */ /* $NetBSD: disks.c,v 1.4 1996/05/10 23:16:33 thorpej Exp $ */ /*- @@ -38,10 +38,11 @@ #if 0 static char sccsid[] = "@(#)disks.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: disks.c,v 1.7 1997/01/31 10:08:37 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: disks.c,v 1.8 1997/06/23 22:21:46 millert Exp $"; #endif /* not lint */ #include <string.h> +#include <ctype.h> #include "systat.h" #include "extern.h" static void dkselect(char *args, int truefalse, int selections[]); diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h index d1ded2d14a0..446436525ef 100644 --- a/usr.bin/systat/extern.h +++ b/usr.bin/systat/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.3 1996/06/26 05:40:06 deraadt Exp $ */ +/* $OpenBSD: extern.h,v 1.4 1997/06/23 22:21:46 millert Exp $ */ /* $NetBSD: extern.h,v 1.3 1996/05/10 23:16:34 thorpej Exp $ */ /*- @@ -51,7 +51,7 @@ extern float *dk_mspw; extern kvm_t *kd; extern long ntext, textp; extern int *dk_select; -extern int CMDLINE; +extern long CMDLINE; extern int dk_ndrive; extern int hz, stathz; extern int naptime, col; diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c index 3ce96c7bd35..205513c76b9 100644 --- a/usr.bin/systat/iostat.c +++ b/usr.bin/systat/iostat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iostat.c,v 1.7 1997/02/04 04:42:42 kstailey Exp $ */ +/* $OpenBSD: iostat.c,v 1.8 1997/06/23 22:21:47 millert Exp $ */ /* $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: iostat.c,v 1.7 1997/02/04 04:42:42 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: iostat.c,v 1.8 1997/06/23 22:21:47 millert Exp $"; #endif not lint #include <sys/param.h> @@ -90,6 +90,7 @@ initiostat() { dkinit(1); dkreadstats(); + return 0; } void @@ -194,7 +195,6 @@ barlabels(row) void showiostat() { - register u_int64_t t; register int i, row, col; dkswap(); diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index ead475070c0..ebfa4c358b4 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.10 1997/06/16 19:10:15 kstailey Exp $ */ +/* $OpenBSD: main.c,v 1.11 1997/06/23 22:21:47 millert Exp $ */ /* $NetBSD: main.c,v 1.8 1996/05/10 23:16:36 thorpej Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: main.c,v 1.10 1997/06/16 19:10:15 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.11 1997/06/23 22:21:47 millert Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -52,9 +52,11 @@ static char rcsid[] = "$OpenBSD: main.c,v 1.10 1997/06/16 19:10:15 kstailey Exp #include <err.h> #include <nlist.h> #include <signal.h> +#include <ctype.h> #include <stdio.h> #include <string.h> #include <unistd.h> +#include <stdlib.h> #include <limits.h> #include "systat.h" @@ -83,11 +85,11 @@ char c; char *namp; char hostname[MAXHOSTNAMELEN]; WINDOW *wnd; -int CMDLINE; +long CMDLINE; static WINDOW *wload; /* one line window for load average */ -static void usage(); +static void usage __P((void)); int main(argc, argv) diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c index 32ad7266690..4190fb822b7 100644 --- a/usr.bin/systat/netcmds.c +++ b/usr.bin/systat/netcmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcmds.c,v 1.3 1997/01/17 07:13:25 millert Exp $ */ +/* $OpenBSD: netcmds.c,v 1.4 1997/06/23 22:21:47 millert Exp $ */ /* $NetBSD: netcmds.c,v 1.4 1995/05/21 17:14:38 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: netcmds.c,v 1.3 1997/01/17 07:13:25 millert Exp $"; +static char rcsid[] = "$OpenBSD: netcmds.c,v 1.4 1997/06/23 22:21:47 millert Exp $"; #endif /* not lint */ /* @@ -176,7 +176,7 @@ selectproto(proto) new = TCP; else if (streq(proto, "udp")) new = UDP; - return (new != protos, protos = new); + return (protos = new); } static void @@ -246,7 +246,7 @@ showports() for (p = ports; p < ports+nports; p++) { sp = getservbyport(p->port, - protos == TCP|UDP ? 0 : protos == TCP ? "tcp" : "udp"); + protos == (TCP|UDP) ? 0 : protos == TCP ? "tcp" : "udp"); if (!p->onoff) addch('!'); if (sp) diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index d51730c4e38..e5bea81435c 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netstat.c,v 1.6 1997/01/17 07:13:26 millert Exp $ */ +/* $OpenBSD: netstat.c,v 1.7 1997/06/23 22:21:48 millert Exp $ */ /* $NetBSD: netstat.c,v 1.3 1995/06/18 23:53:07 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)netstat.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: netstat.c,v 1.6 1997/01/17 07:13:26 millert Exp $"; +static char rcsid[] = "$OpenBSD: netstat.c,v 1.7 1997/06/23 22:21:48 millert Exp $"; #endif /* not lint */ /* @@ -68,6 +68,7 @@ static char rcsid[] = "$OpenBSD: netstat.c,v 1.6 1997/01/17 07:13:26 millert Exp #include <netinet/tcp_debug.h> #include <netinet/udp.h> #include <netinet/udp_var.h> +#include <arpa/inet.h> #include <netdb.h> #include <stdlib.h> diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c index 66f044353ee..b040047dd04 100644 --- a/usr.bin/systat/pigs.c +++ b/usr.bin/systat/pigs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pigs.c,v 1.3 1996/06/26 05:40:10 deraadt Exp $ */ +/* $OpenBSD: pigs.c,v 1.4 1997/06/23 22:21:48 millert Exp $ */ /* $NetBSD: pigs.c,v 1.3 1995/04/29 05:54:50 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)pigs.c 8.2 (Berkeley) 9/23/93"; #endif -static char rcsid[] = "$OpenBSD: pigs.c,v 1.3 1996/06/26 05:40:10 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: pigs.c,v 1.4 1997/06/23 22:21:48 millert Exp $"; #endif /* not lint */ /* @@ -132,7 +132,7 @@ showpigs() wmove(wnd, y, 0); wclrtoeol(wnd); mvwaddstr(wnd, y, 0, uname); - sprintf(pidname, "%10.10s", pname, 0); + sprintf(pidname, "%10.10s", pname); mvwaddstr(wnd, y, 9, pidname); wmove(wnd, y, 20); for (j = pt[k].pt_pctcpu*factor + 0.5; j > 0; j--) diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c index 4e2a2b9deeb..12ebe33b011 100644 --- a/usr.bin/systat/swap.c +++ b/usr.bin/systat/swap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: swap.c,v 1.8 1997/04/01 18:11:58 deraadt Exp $ */ +/* $OpenBSD: swap.c,v 1.9 1997/06/23 22:21:49 millert Exp $ */ /* $NetBSD: swap.c,v 1.5 1996/05/10 23:16:38 thorpej Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95"; #endif -static char rcsid[] = "$OpenBSD: swap.c,v 1.8 1997/04/01 18:11:58 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: swap.c,v 1.9 1997/06/23 22:21:49 millert Exp $"; #endif /* not lint */ /* @@ -78,7 +78,7 @@ struct nlist syms[] = { #define VM_NSWDEV 4 { "_dmmax" }, /* maximum size of a swap block */ #define VM_DMMAX 5 - 0 + { 0 } }; static int nswap, nswdev, dmmax, nswapmap; @@ -116,6 +116,7 @@ closeswap(w) delwin(w); } +int initswap() { int i; @@ -226,7 +227,7 @@ labelswap() void showswap() { - int col, row, div, i, j, avail, npfree, used, xsize, xfree; + int col, div, i, j, avail, npfree, used, xsize, xfree; div = blocksize / 512; avail = npfree = 0; diff --git a/usr.bin/systat/systat.h b/usr.bin/systat/systat.h index d0725aa9dec..572ac2bc492 100644 --- a/usr.bin/systat/systat.h +++ b/usr.bin/systat/systat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: systat.h,v 1.2 1996/06/26 05:40:12 deraadt Exp $ */ +/* $OpenBSD: systat.h,v 1.3 1997/06/23 22:21:49 millert Exp $ */ /* $NetBSD: systat.h,v 1.2 1995/01/20 08:52:14 jtc Exp $ */ /*- @@ -39,15 +39,15 @@ #include <curses.h> struct cmdtab { - char *c_name; /* command name */ - void (*c_refresh)(); /* display refresh */ - void (*c_fetch)(); /* sets up data structures */ - void (*c_label)(); /* label display */ - int (*c_init)(); /* initialize namelist, etc. */ - WINDOW *(*c_open)(); /* open display */ - void (*c_close)(); /* close display */ - int (*c_cmd)(); /* display command interpreter */ - char c_flags; /* see below */ + char *c_name; /* command name */ + void (*c_refresh) __P((void)); /* display refresh */ + void (*c_fetch) __P((void)); /* sets up data structures */ + void (*c_label) __P((void)); /* label display */ + int (*c_init) __P((void)); /* initialize namelist, etc. */ + WINDOW *(*c_open) __P((void)); /* open display */ + void (*c_close) __P((WINDOW *)); /* close display */ + int (*c_cmd) __P((char *, char *)); /* display command interpreter */ + char c_flags; /* see below */ }; #define CF_INIT 0x1 /* been initialized */ |