summaryrefslogtreecommitdiff
path: root/usr.bin/systat/cmdtab.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-11-23 22:20:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-11-23 22:20:07 +0000
commit2b5bf0455cfdd3b06f52578c304a38c1bf3a7b71 (patch)
tree37ef459856cfa832a96015c1198685a1d081c657 /usr.bin/systat/cmdtab.c
parent6df9f030ceddc8afca7343c0bfe949a027e08212 (diff)
fix signal races. use sysctl() instead of kvm where possible, and then KNF
the hell out of it; checked by miod
Diffstat (limited to 'usr.bin/systat/cmdtab.c')
-rw-r--r--usr.bin/systat/cmdtab.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/usr.bin/systat/cmdtab.c b/usr.bin/systat/cmdtab.c
index cc71c61ad3d..d4d52dd91ab 100644
--- a/usr.bin/systat/cmdtab.c
+++ b/usr.bin/systat/cmdtab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmdtab.c,v 1.2 1996/06/26 05:40:05 deraadt Exp $ */
+/* $OpenBSD: cmdtab.c,v 1.3 2001/11/23 22:20:06 deraadt Exp $ */
/* $NetBSD: cmdtab.c,v 1.2 1995/01/20 08:51:51 jtc Exp $ */
/*-
@@ -38,31 +38,34 @@
#if 0
static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: cmdtab.c,v 1.2 1996/06/26 05:40:05 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: cmdtab.c,v 1.3 2001/11/23 22:20:06 deraadt Exp $";
#endif /* not lint */
+#include <sys/types.h>
+#include <signal.h>
+
#include "systat.h"
#include "extern.h"
struct cmdtab cmdtab[] = {
- { "pigs", showpigs, fetchpigs, labelpigs,
+ { "pigs", showpigs, fetchpigs, labelpigs,
initpigs, openpigs, closepigs, 0,
CF_LOADAV },
- { "swap", showswap, fetchswap, labelswap,
+ { "swap", showswap, fetchswap, labelswap,
initswap, openswap, closeswap, 0,
CF_LOADAV },
- { "mbufs", showmbufs, fetchmbufs, labelmbufs,
+ { "mbufs", showmbufs, fetchmbufs, labelmbufs,
initmbufs, openmbufs, closembufs, 0,
CF_LOADAV },
- { "iostat", showiostat, fetchiostat, labeliostat,
+ { "iostat", showiostat, fetchiostat, labeliostat,
initiostat, openiostat, closeiostat, cmdiostat,
CF_LOADAV },
- { "vmstat", showkre, fetchkre, labelkre,
+ { "vmstat", showkre, fetchkre, labelkre,
initkre, openkre, closekre, cmdkre,
0 },
- { "netstat", shownetstat, fetchnetstat, labelnetstat,
+ { "netstat", shownetstat, fetchnetstat, labelnetstat,
initnetstat, opennetstat, closenetstat, cmdnetstat,
CF_LOADAV },
- { 0 }
+ { 0 }
};
struct cmdtab *curcmd = &cmdtab[0];