summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2010-03-18 12:47:49 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2010-03-18 12:47:49 +0000
commitc714103a0834bb6407a6e57cbfc43851bcf07e0a (patch)
treede780e05510859be1f85f54dc1f4d8c5a3bcaf7b
parent58a49fb129b5319c23ad5fa71d9d92eb2688be72 (diff)
While resizing, show correct CPU stats, from Mark Lumsden
-rw-r--r--usr.bin/top/top.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 679752a1fc7..baacde202f0 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.69 2010/01/29 00:36:09 tedu Exp $ */
+/* $OpenBSD: top.c,v 1.70 2010/03/18 12:47:48 otto Exp $ */
/*
* Top users/processes display for Unix
@@ -407,6 +407,24 @@ restart:
* indicates infinity (by being -1)
*/
while ((displays == -1) || (displays-- > 0)) {
+ if (winchflag) {
+ /*
+ * reascertain the screen
+ * dimensions
+ */
+ get_screensize();
+ resizeterm(screen_length, screen_width + 1);
+
+ /* tell display to resize */
+ max_topn = display_resize();
+
+ /* reset the signal handler */
+ (void) signal(SIGWINCH, sigwinch);
+
+ reset_display();
+ winchflag = 0;
+ }
+
/* get the current stats */
get_system_info(&system_info);
@@ -566,24 +584,6 @@ rundisplay(void)
tstopflag = 0;
return 1;
}
- if (winchflag) {
- /*
- * reascertain the screen
- * dimensions
- */
- get_screensize();
- resizeterm(screen_length, screen_width + 1);
-
- /* tell display to resize */
- max_topn = display_resize();
-
- /* reset the signal handler */
- (void) signal(SIGWINCH, sigwinch);
-
- reset_display();
- winchflag = 0;
- return 1;
- }
/*
* wait for either input or the end
* of the delay period