summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/main.c25
-rw-r--r--usr.bin/systat/pftop.c17
-rw-r--r--usr.bin/systat/systat.h3
3 files changed, 19 insertions, 26 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 46d75e8471f..fb8a9e58f4d 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.49 2008/11/04 19:00:08 espie Exp $ */
+/* $Id: main.c,v 1.50 2008/11/05 15:48:44 canacar Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -69,6 +69,9 @@ int CMDLINE;
#define TIMEPOS 55
+int ucount(void);
+void usage(void);
+
/* command prompt */
void cmd_delay(const char *);
@@ -85,11 +88,8 @@ struct command cm_count = {"Number of lines to display", cmd_count};
int
print_header(void)
{
- struct tm *tp;
- time_t t, now;
- order_type *ordering;
+ time_t now;
int start = dispstart + 1, end = dispstart + maxprint;
- extern int ucount();
char tbuf[26];
if (end > num_disp)
@@ -97,17 +97,6 @@ print_header(void)
tb_start();
-#if 0
- if (curr_mgr && curr_mgr->sort_fn != NULL) {
- ordering = curr_mgr->order_curr;
- if (ordering != NULL) {
- tbprintf(", Order: %s", ordering->name);
- if (sortdir < 0 && ordering->func != NULL)
- tbprintf(" (rev)");
- }
- }
-#endif
-
getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
time(&now);
@@ -205,7 +194,7 @@ ucount(void)
/* main program functions */
void
-usage()
+usage(void)
{
extern char *__progname;
fprintf(stderr, "usage: %s [-abin] [-d count] "
@@ -237,8 +226,6 @@ add_view_tb(field_view *v)
void
show_help(void)
{
- int line = 0;
-
if (rawmode)
return;
diff --git a/usr.bin/systat/pftop.c b/usr.bin/systat/pftop.c
index 84b61486ed8..0847805f06a 100644
--- a/usr.bin/systat/pftop.c
+++ b/usr.bin/systat/pftop.c
@@ -1,4 +1,4 @@
-/* $Id: pftop.c,v 1.6 2008/10/08 15:11:13 canacar Exp $ */
+/* $Id: pftop.c,v 1.7 2008/11/05 15:48:44 canacar Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -94,6 +94,8 @@ int select_queues(void);
int read_queues(void);
void print_queues(void);
+void update_cache(void);
+
/* qsort callbacks */
int sort_size_callback(const void *s1, const void *s2);
int sort_exp_callback(const void *s1, const void *s2);
@@ -1579,7 +1581,7 @@ pfctl_update_qstats(struct pf_altq_node **root, int *inserts)
gettimeofday(&qstats.timestamp, NULL);
if ((node = pfctl_find_altq_node(*root, pa.altq.qname,
pa.altq.ifname)) != NULL) {
- // update altq data too as bandwidth may have changed
+ /* update altq data too as bandwidth may have changed */
memcpy(&node->altq, &pa.altq, sizeof(struct pf_altq));
memcpy(&node->qstats_last, &node->qstats,
sizeof(struct queue_stats));
@@ -1662,8 +1664,9 @@ read_queues(void)
if (pfctl_update_qstats(&altq_root, &inserts))
return (-1);
- // Allow inserts only on first read;
- // on subsequent reads clear and reload
+ /* Allow inserts only on first read;
+ * on subsequent reads clear and reload
+ */
if (first_read == 0 &&
(inserts != 0 || pfctl_have_unvisited(altq_root) != 0)) {
pfctl_free_altq_node(altq_root);
@@ -1832,7 +1835,7 @@ print_queues(void)
/* main program functions */
void
-update_cache()
+update_cache(void)
{
static int pstate = -1;
if (pstate == cachestates)
@@ -1851,7 +1854,7 @@ update_cache()
field_setup();
}
-void
+int
initpftop(void)
{
struct pf_status status;
@@ -1881,4 +1884,6 @@ initpftop(void)
show_field(FLD_STMAX);
show_field(FLD_ANCHOR);
+
+ return (1);
}
diff --git a/usr.bin/systat/systat.h b/usr.bin/systat/systat.h
index cb0c60e0770..ccf1c8b6289 100644
--- a/usr.bin/systat/systat.h
+++ b/usr.bin/systat/systat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systat.h,v 1.10 2008/11/02 06:23:28 canacar Exp $ */
+/* $OpenBSD: systat.h,v 1.11 2008/11/05 15:48:44 canacar Exp $ */
/* $NetBSD: systat.h,v 1.2 1995/01/20 08:52:14 jtc Exp $ */
/*-
@@ -81,6 +81,7 @@ int initmembufs(void);
int initpigs(void);
int initswap(void);
int initvmstat(void);
+int initpftop(void);
int initpf(void);
int initpool(void);