Subject: bin/26150: systat(1) resize does not work correct
To: None <gnats-bugs@gnats.NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: netbsd-bugs
Date: 07/03/2004 12:54:29
>Number:         26150
>Category:       bin
>Synopsis:       systat(1) resize does not work correct
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 03 10:55:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Peter Postma
>Release:        NetBSD 2.0G
>Organization:
>Environment:
System: NetBSD mercury.pointless.nl 2.0G NetBSD 2.0G (mercury) #11: Fri Jul 2 17:57:06 CEST 2004 peter@mercury.pointless.nl:/usr/obj/sys/arch/sparc64/compile/mercury sparc64
Architecture: sparc64
Machine: sparc64
>Description:
In rev. 1.31 of src/usr.bin/systat/main.c, there was support added for window
resize, but in rev 1.33 there was a change made which breaks the resizing.
I believe that LINES and COLS are not updated until resizeterm() is called.
>How-To-Repeat:
Start systat(1) and resize the window.
>Fix:
Backout rev 1.33:

Index: main.c
===================================================================
RCS file: /cvsroot/src/usr.bin/systat/main.c,v
retrieving revision 1.35
diff -u -r1.35 main.c
--- main.c	7 Aug 2003 11:15:59 -0000	1.35
+++ main.c	3 Jul 2004 10:52:04 -0000
@@ -326,8 +326,7 @@
 	sigaddset(&set, SIGALRM);
 	sigprocmask(SIG_BLOCK, &set, NULL);
 
-	if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) != -1 &&
-	    (win.ws_row != LINES || win.ws_col != COLS)) {
+	if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) != -1) {
 		resizeterm(win.ws_row, win.ws_col);
 		CMDLINE = LINES - 1;
 		labels();
>Release-Note:
>Audit-Trail:
>Unformatted: