NetBSD Problem Report #8671
Received: (qmail 16974 invoked from network); 24 Oct 1999 00:20:02 -0000
Message-Id: <199910240018.RAA12959@svcs.plectere.com>
Date: Sat, 23 Oct 1999 17:18:53 -0700 (PDT)
From: Paul Shupak <paul@Plectere.com>
Reply-To: paul@Plectere.com
To: gnats-bugs@gnats.netbsd.org
Subject: bug in systat
X-Send-Pr-Version: 3.95
>Number: 8671
>Category: bin
>Synopsis: display of io:numbers is wrong for large numbers of drives
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Oct 23 17:20:59 +0000 1999
>Closed-Date: Sun Nov 30 16:52:20 +0000 2003
>Last-Modified: Sun Nov 30 16:52:20 +0000 2003
>Originator: Paul Shupak
>Release: NetBSD-current Sat Oct 23 1999
>Organization:
>Environment:
System: NetBSD svcs 1.4K NetBSD 1.4K (PCOM) #17: Thu Oct 7 16:25:37 PDT 1999 paul@cobalt:/usr/src/sys/arch/i386/compile/PCOM i386
>Description:
When calculating the number of drives per line, the code uses
different expressions for the labels versus the data itself: This
causes the labels to not match ( e.g when displaying 8 spindles in
two groups, there are 4 names per group but five sets of data in the
first and three sets in the second ).
Additionally, the computation has a "greater-than-or-equal"
when it should be just "greater-than". Also, the format strings
passed to printf contains a space, where increasing the field width
is more appropriate ( i.e. when overflowing by one digit, the columns
will still be aligned ).
>How-To-Repeat:
On a machine with 5 or more spindles ( for a 80 column display ),
run "systat io", then change the display format with ":numbers"
and notice that the display is wrong.
>Fix:
*** iostat.c-ORIG Fri Oct 22 18:05:22 1999
--- iostat.c Fri Oct 22 18:02:44 1999
***************
*** 141,143 ****
#define COLWIDTH 14
! #define DRIVESPERLINE ((getmaxx(wnd) - INSET) / COLWIDTH)
for (ndrives = 0, i = 0; i < dk_ndrive; i++)
--- 141,143 ----
#define COLWIDTH 14
! #define DRIVESPERLINE (getmaxx(wnd) / COLWIDTH)
for (ndrives = 0, i = 0; i < dk_ndrive; i++)
***************
*** 159,161 ****
if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) {
! if (col + COLWIDTH >= getmaxx(wnd) - INSET) {
col = 0, row += linesperregion + 1;
--- 159,161 ----
if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) {
! if (col + COLWIDTH > getmaxx(wnd)) {
col = 0, row += linesperregion + 1;
***************
*** 235,237 ****
if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) {
! if (col + COLWIDTH >= getmaxx(wnd)) {
col = 0, row += linesperregion + 1;
--- 235,237 ----
if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) {
! if (col + COLWIDTH > getmaxx(wnd)) {
col = 0, row += linesperregion + 1;
***************
*** 261,263 ****
if (numbers) {
! mvwprintw(wnd, row, col, " %3.0f%4.0f%5.1f",
words / etime, cur.dk_xfer[dn] / etime, atime / etime);
--- 261,263 ----
if (numbers) {
! mvwprintw(wnd, row, col, "%4.0f%4.0f%5.1f",
words / etime, cur.dk_xfer[dn] / etime, atime / etime);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: dsl
State-Changed-When: Sun Nov 30 16:51:58 UTC 2003
State-Changed-Why:
I remember fixing this bug earlier in the year.
>Unformatted:
(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.