NetBSD Problem Report #3431

Received: (qmail-queue invoked from smtpd); 1 Apr 1997 14:27:28 -0000
Message-Id: <199704011426.QAA28772@wit387304.student.utwente.nl>
Date: Tue, 1 Apr 1997 16:26:42 +0200 (CEST)
From: Paul Boven <paul@wit387304.student.utwente.nl>
Reply-To: paul@wit387304.student.utwente.nl
To: gnats-bugs@gnats.netbsd.org
Subject: bugfix for systat (swap.c)
X-Send-Pr-Version: 3.95

>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
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 01 06:35:01 +0000 1997
>Closed-Date:    Wed Apr 02 22:08:20 +0000 1997
>Last-Modified:  Thu Apr 03 06:09:09 +0000 1997
>Originator:     Paul Boven
>Release:        NetBSD-current usr.bin/systat/swap.c 1-apr-97
>Organization:
----------------------------------------------------------------------
Paul Boven, <e.p.boven@student.utwente.nl>  PE1NUT  QRV 145.575 JO32KF
          Lynx users have a "Right to follow a link", too!
----------------------------------------------------------------------
>Environment:
System: NetBSD wit387304.student.utwente.nl 1.2C NetBSD 1.2C (ELC) #12: Thu Feb 27 09:09:06 CET 1997 paul@wit387304.student.utwente.nl:/usr/src/sys/arch/sparc/compile/ELC sparc

>Description:
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.
>How-To-Repeat:
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.
>Fix:
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');
  		npfree++;
>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: mikel
State-Changed-When: Wed Apr  2 22:08:20 1997
State-Changed-Why:
fixed as suggested, with two changes: clear to eol after printing Xs,
and fix totals bar as well.  thanks.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.