Subject: bin/3431: bugfix for systat (swap.c)
To: None <>
From: Paul Boven <>
List: netbsd-bugs
Date: 04/01/1997 16:26:42
>Number:         3431
>Category:       bin
>Synopsis:       The swap-usage-bar would only go up, not down.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr  1 06:35:01 1997
>Originator:     Paul Boven
Paul Boven, <>  PE1NUT  QRV 145.575 JO32KF
          Lynx users have a "Right to follow a link", too!
>Release:        NetBSD-current usr.bin/systat/swap.c 1-apr-97
System: NetBSD 1.2C NetBSD 1.2C (ELC) #12: Thu Feb 27 09:09:06 CET 1997 sparc

When using the swap display of systat to monitor VM-usage, the XXX-bar will
only grow, but not decrease again. The numeric values are reported correctly,
though. This problem occurs because the line on which the bar is drawn is
not cleared before it's redrawn again. Although a shorter bar is printed,
the remainder of previous (longer) bars is not overwritten.
Start systat in the swap mode (either by entering :swap or giving swap as 
argument when starting systat). Start some VM-hungry applications. The
XXX-bar will increase. End those applications again: the numbers for VM-
usage will decrease again, but the bar will stay at it's maximum length.
Clear the line with the bar on it before redrawing the bar.

*** swap.c.orig	Tue Apr  1 16:13:17 1997
--- swap.c	Tue Apr  1 15:52:46 1997
*** 242,247 ****
--- 242,248 ----
  		xfree = perdev[i];
  		used = xsize - xfree;
  		mvwprintw(wnd, i + 1, col, "%9d  ", used / div);
+ 		wclrtoeol(wnd);
  		for (j = (100 * used / xsize + 1) / 2; j > 0; j--)
  			waddch(wnd, 'X');