summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2010-02-05 10:21:10 +0000
committerotto <otto@openbsd.org>2010-02-05 10:21:10 +0000
commit69fa09f346f1b982a8e63d70a3a25c9723e38f80 (patch)
tree169311191bdaa262ee4778d9de3a6b1ff84e3617
parentregen (diff)
downloadwireguard-openbsd-69fa09f346f1b982a8e63d70a3a25c9723e38f80.tar.xz
wireguard-openbsd-69fa09f346f1b982a8e63d70a3a25c9723e38f80.zip
Header_lines always has the same value as y_procs; so zap the former;
from Mark Lumsden.
-rw-r--r--usr.bin/top/display.c6
-rw-r--r--usr.bin/top/screen.c5
-rw-r--r--usr.bin/top/top.h5
3 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c
index 7b2005c775f..1e527c04e98 100644
--- a/usr.bin/top/display.c
+++ b/usr.bin/top/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.36 2010/01/29 00:36:09 tedu Exp $ */
+/* $OpenBSD: display.c,v 1.37 2010/02/05 10:21:10 otto Exp $ */
/*
* Top users/processes display for Unix
@@ -100,7 +100,6 @@ int y_idlecursor;
int y_procs;
extern int ncpu;
extern int combine_cpus;
-int Header_lines;
int header_status = Yes;
@@ -130,11 +129,10 @@ display_resize(void)
y_mem = 2 + cpu_lines;
y_header = 4 + cpu_lines;
y_procs = 5 + cpu_lines;
- Header_lines = 5 + cpu_lines;
/* calculate the current dimensions */
/* if operating in "dumb" mode, we only need one line */
- display_lines = smart_terminal ? screen_length - Header_lines : 1;
+ display_lines = smart_terminal ? screen_length - y_procs : 1;
y_idlecursor = y_message = 3 + (combine_cpus ? 1 : ncpu);
if (screen_length <= y_message)
diff --git a/usr.bin/top/screen.c b/usr.bin/top/screen.c
index 7c633408a7f..b4d13760958 100644
--- a/usr.bin/top/screen.c
+++ b/usr.bin/top/screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.c,v 1.19 2008/09/24 18:53:55 chl Exp $ */
+/* $OpenBSD: screen.c,v 1.20 2010/02/05 10:21:10 otto Exp $ */
/*
* Top users/processes display for Unix
@@ -49,6 +49,7 @@
#include "top.h"
#include "screen.h"
+#include "layout.h"
#include "boolean.h"
int screen_length, screen_width;
@@ -104,7 +105,7 @@ init_termcap(int interactive)
}
/* set up common terminal capabilities */
- if ((screen_length = tgetnum("li")) <= Header_lines) {
+ if ((screen_length = tgetnum("li")) <= y_procs) {
screen_length = smart_terminal = 0;
return;
}
diff --git a/usr.bin/top/top.h b/usr.bin/top/top.h
index f9609c0e18e..2e181281eca 100644
--- a/usr.bin/top/top.h
+++ b/usr.bin/top/top.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.h,v 1.11 2007/09/25 06:02:36 otto Exp $ */
+/* $OpenBSD: top.h,v 1.12 2010/02/05 10:21:10 otto Exp $ */
/*
* Top users/processes display for Unix
@@ -39,9 +39,6 @@
/* Current major version number */
#define VERSION 3
-/* Number of lines of header information on the standard screen */
-extern int Header_lines;
-
/* Maximum number of columns allowed for display */
#define MAX_COLS 256