summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 00:03:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 00:03:39 +0000
commit3ac4c762270cc234339783681ac2bb1a6f348783 (patch)
tree273a84f9b8743c569ce12325ddcc19d944cd7a10
parent9cfecc3be5cf6ce688b9511f20bf68f74b38a4c1 (diff)
first batch of programs adapting to the namespace cleanup
(pfvar.h nameser.h proc.h ucred.h) ok guenther millert, and some review from doug as well.
-rw-r--r--usr.bin/systat/cpu.c4
-rw-r--r--usr.bin/systat/if.c6
-rw-r--r--usr.bin/systat/inetname.c4
-rw-r--r--usr.bin/systat/iostat.c5
-rw-r--r--usr.bin/systat/main.c5
-rw-r--r--usr.bin/systat/malloc.c5
-rw-r--r--usr.bin/systat/mbufs.c7
-rw-r--r--usr.bin/systat/netstat.c6
-rw-r--r--usr.bin/systat/nfs.c5
-rw-r--r--usr.bin/systat/pf.c3
-rw-r--r--usr.bin/systat/pftop.c5
-rw-r--r--usr.bin/systat/pigs.c5
-rw-r--r--usr.bin/systat/pool.c5
-rw-r--r--usr.bin/systat/sensors.c5
-rw-r--r--usr.bin/systat/swap.c5
-rw-r--r--usr.bin/systat/vmstat.c13
16 files changed, 51 insertions, 37 deletions
diff --git a/usr.bin/systat/cpu.c b/usr.bin/systat/cpu.c
index 512a8807db9..520bb9389f8 100644
--- a/usr.bin/systat/cpu.c
+++ b/usr.bin/systat/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.3 2014/09/15 19:08:21 miod Exp $ */
+/* $OpenBSD: cpu.c,v 1.4 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
@@ -46,7 +46,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
diff --git a/usr.bin/systat/if.c b/usr.bin/systat/if.c
index 9f83ad943b1..18e9a4f4706 100644
--- a/usr.bin/systat/if.c
+++ b/usr.bin/systat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.22 2014/10/08 04:10:04 doug Exp $ */
+/* $OpenBSD: if.c,v 1.23 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
*
@@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
-#include <sys/types.h>
+#include <sys/param.h> /* roundup */
+#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
diff --git a/usr.bin/systat/inetname.c b/usr.bin/systat/inetname.c
index effa249b26d..3503ce5b6b5 100644
--- a/usr.bin/systat/inetname.c
+++ b/usr.bin/systat/inetname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetname.c,v 1.1 2010/07/22 12:33:29 giovanni Exp $ */
+/* $OpenBSD: inetname.c,v 1.2 2015/01/16 00:03:37 deraadt Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c
index cb3601e1a69..902084214ec 100644
--- a/usr.bin/systat/iostat.c
+++ b/usr.bin/systat/iostat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iostat.c,v 1.44 2014/11/23 04:34:48 guenther Exp $ */
+/* $OpenBSD: iostat.c,v 1.45 2015/01/16 00:03:37 deraadt Exp $ */
/* $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $ */
/*
@@ -30,8 +30,9 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mount.h>
+#include <sys/signal.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/time.h>
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 258603a5adb..9a7ff7194a1 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.60 2013/09/07 11:43:50 reyk Exp $ */
+/* $Id: main.c,v 1.61 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -31,7 +31,6 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/sysctl.h>
@@ -65,7 +64,7 @@ double naptime = 5.0;
int verbose = 1; /* to report kvm read errs */
int nflag = 1;
int ut, hz, stathz;
-char hostname[MAXHOSTNAMELEN];
+char hostname[HOST_NAME_MAX+1];
WINDOW *wnd;
int CMDLINE;
char timebuf[26];
diff --git a/usr.bin/systat/malloc.c b/usr.bin/systat/malloc.c
index 7d93c396030..bd7fb631547 100644
--- a/usr.bin/systat/malloc.c
+++ b/usr.bin/systat/malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.c,v 1.2 2011/03/02 06:48:17 jasper Exp $ */
+/* $OpenBSD: malloc.c,v 1.3 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
*
@@ -16,12 +16,13 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/malloc.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "systat.h"
diff --git a/usr.bin/systat/mbufs.c b/usr.bin/systat/mbufs.c
index 158d5ed91d1..e9b2fe315ba 100644
--- a/usr.bin/systat/mbufs.c
+++ b/usr.bin/systat/mbufs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbufs.c,v 1.37 2014/11/06 12:50:55 dlg Exp $ */
+/* $OpenBSD: mbufs.c,v 1.38 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
*
@@ -14,8 +14,9 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
-#include <sys/types.h>
+
+#include <sys/param.h> /* MSIZE */
+#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/mbuf.h>
diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c
index ae8d9366ed5..e40bc186c19 100644
--- a/usr.bin/systat/netstat.c
+++ b/usr.bin/systat/netstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netstat.c,v 1.42 2014/10/24 10:18:49 schwarze Exp $ */
+/* $OpenBSD: netstat.c,v 1.43 2015/01/16 00:03:37 deraadt Exp $ */
/* $NetBSD: netstat.c,v 1.3 1995/06/18 23:53:07 cgd Exp $ */
/*-
@@ -33,7 +33,9 @@
/*
* netstat
*/
-#include <sys/param.h>
+
+#include <sys/param.h> /* MSIZE */
+#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/mbuf.h>
diff --git a/usr.bin/systat/nfs.c b/usr.bin/systat/nfs.c
index c082ffa8db2..cb74afdca11 100644
--- a/usr.bin/systat/nfs.c
+++ b/usr.bin/systat/nfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs.c,v 1.6 2011/03/02 06:48:17 jasper Exp $ */
+/* $OpenBSD: nfs.c,v 1.7 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2009 Jasper Lievisse Adriaanse <jasper@openbsd.org>
@@ -17,8 +17,9 @@
*
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mount.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <nfs/rpcv2.h>
diff --git a/usr.bin/systat/pf.c b/usr.bin/systat/pf.c
index 0cfc56d887a..08336183d34 100644
--- a/usr.bin/systat/pf.c
+++ b/usr.bin/systat/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.6 2014/08/14 12:55:50 mpi Exp $ */
+/* $OpenBSD: pf.c,v 1.7 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar <canacar@openbsd.org>
*
@@ -18,6 +18,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <sys/signal.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/ip.h>
diff --git a/usr.bin/systat/pftop.c b/usr.bin/systat/pftop.c
index 582fd016d8d..33fed4501f4 100644
--- a/usr.bin/systat/pftop.c
+++ b/usr.bin/systat/pftop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pftop.c,v 1.29 2014/10/11 04:30:56 doug Exp $ */
+/* $OpenBSD: pftop.c,v 1.30 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -54,6 +54,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <stdarg.h>
#include "systat.h"
@@ -997,7 +998,7 @@ read_anchor_rules(char *anchor)
}
struct anchor_name {
- char name[MAXPATHLEN];
+ char name[PATH_MAX];
struct anchor_name *next;
u_int32_t ref;
};
diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c
index 57ef13a9038..515d9f22409 100644
--- a/usr.bin/systat/pigs.c
+++ b/usr.bin/systat/pigs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pigs.c,v 1.28 2014/10/08 04:10:04 doug Exp $ */
+/* $OpenBSD: pigs.c,v 1.29 2015/01/16 00:03:37 deraadt Exp $ */
/* $NetBSD: pigs.c,v 1.3 1995/04/29 05:54:50 cgd Exp $ */
/*-
@@ -34,7 +34,8 @@
* Pigs display from Bill Reeves at Lucasfilm
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/signal.h>
#include <sys/proc.h>
#include <sys/resource.h>
#include <sys/sched.h>
diff --git a/usr.bin/systat/pool.c b/usr.bin/systat/pool.c
index b4d3a24e04b..460d49967bb 100644
--- a/usr.bin/systat/pool.c
+++ b/usr.bin/systat/pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pool.c,v 1.9 2014/10/08 04:10:04 doug Exp $ */
+/* $OpenBSD: pool.c,v 1.10 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
*
@@ -16,12 +16,13 @@
*/
#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/pool.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "systat.h"
diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c
index 16861750462..971a139562e 100644
--- a/usr.bin/systat/sensors.c
+++ b/usr.bin/systat/sensors.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.c,v 1.29 2014/10/08 04:10:04 doug Exp $ */
+/* $OpenBSD: sensors.c,v 1.30 2015/01/16 00:03:38 deraadt Exp $ */
/*
* Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org>
@@ -19,7 +19,8 @@
*
*/
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/sensors.h>
diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c
index f15d4157906..b0cf4d1958a 100644
--- a/usr.bin/systat/swap.c
+++ b/usr.bin/systat/swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: swap.c,v 1.25 2014/11/23 04:34:48 guenther Exp $ */
+/* $OpenBSD: swap.c,v 1.26 2015/01/16 00:03:38 deraadt Exp $ */
/* $NetBSD: swap.c,v 1.9 1998/12/26 07:05:08 marc Exp $ */
/*-
@@ -31,7 +31,8 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/conf.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index a3dddd7cef1..6a644946f28 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmstat.c,v 1.78 2014/11/23 04:34:48 guenther Exp $ */
+/* $OpenBSD: vmstat.c,v 1.79 2015/01/16 00:03:38 deraadt Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
@@ -34,7 +34,8 @@
* Cursed vmstat -- from Robert Elz.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/types.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/sched.h>
@@ -53,6 +54,9 @@
#include <unistd.h>
#include "systat.h"
+#include "dkstats.h"
+
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
static struct Info {
long time[CPUSTATES];
@@ -63,7 +67,6 @@ static struct Info {
u_quad_t *intrcnt;
} s, s1, s2, s3, z;
-#include "dkstats.h"
extern struct _disk cur;
#define cnt s.Cnt
@@ -279,7 +282,7 @@ labelkre(void)
mvprintw(DISKROW + 4, DISKCOL, " sec");
for (i = 0, j = 0; i < cur.dk_ndrive && j < DRIVESPACE; i++)
if (cur.dk_select[i] && (j + strlen(dr_name[i])) < DRIVESPACE) {
- l = MAX(5, strlen(dr_name[i]));
+ l = MAXIMUM(5, strlen(dr_name[i]));
mvprintw(DISKROW, DISKCOL + 5 + j,
" %*s", l, dr_name[i]);
j += 1 + l;
@@ -427,7 +430,7 @@ showkre(void)
mvprintw(DISKROW, DISKCOL + 5, " ");
for (i = 0, c = 0; i < cur.dk_ndrive && c < DRIVESPACE; i++)
if (cur.dk_select[i] && (c + strlen(dr_name[i])) < DRIVESPACE) {
- l = MAX(5, strlen(dr_name[i]));
+ l = MAXIMUM(5, strlen(dr_name[i]));
mvprintw(DISKROW, DISKCOL + 5 + c,
" %*s", l, dr_name[i]);
c += 1 + l;