Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/systat PR bin/56014 from Kouichi Hashikawa



details:   https://anonhg.NetBSD.org/src/rev/8a92d56bb53e
branches:  trunk
changeset: 374041:8a92d56bb53e
user:      kre <kre%NetBSD.org@localhost>
date:      Tue Mar 28 00:00:30 2023 +0000

description:
PR bin/56014 from Kouichi Hashikawa

Don't try to optimise away placing the "s" or " " after "N user"
(" " where N==1, "s" otherwise) when it seems unnecessary, as that
fails when the number of users hasn't changed, but the screen is
being redrawn from nothing (as in after being resumed from a ^Z,
as in the PR, but just doing a ^L would make the same thing happen).

XXX pullup -10 (maybe -9 as well - seems too trivial for -8).

diffstat:

 usr.bin/systat/vmstat.c |  17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diffs (43 lines):

diff -r 3d63e6061ccc -r 8a92d56bb53e usr.bin/systat/vmstat.c
--- a/usr.bin/systat/vmstat.c   Mon Mar 27 23:20:13 2023 +0000
+++ b/usr.bin/systat/vmstat.c   Tue Mar 28 00:00:30 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmstat.c,v 1.91 2021/11/09 09:19:01 nia Exp $  */
+/*     $NetBSD: vmstat.c,v 1.92 2023/03/28 00:00:30 kre Exp $  */
 
 /*-
  * Copyright (c) 1983, 1989, 1992, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c   8.2 (Berkeley) 1/12/94";
 #endif
-__RCSID("$NetBSD: vmstat.c,v 1.91 2021/11/09 09:19:01 nia Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.92 2023/03/28 00:00:30 kre Exp $");
 #endif /* not lint */
 
 /*
@@ -703,19 +703,16 @@ vmstat_zero(char *args)
 static int
 ucount(void)
 {
-       static int onusers = -1;
        int nusers = 0;
        struct utmpentry *ehead;
 
        nusers = getutentries(NULL, &ehead);
 
-       if (nusers != onusers) {
-               if (nusers == 1)
-                       mvprintw(STATROW, STATCOL + 8, " ");
-               else
-                       mvprintw(STATROW, STATCOL + 8, "s");
-       }
-       onusers = nusers;
+       if (nusers == 1)
+               mvprintw(STATROW, STATCOL + 8, " ");
+       else
+               mvprintw(STATROW, STATCOL + 8, "s");
+
        return (nusers);
 }
 



Home | Main Index | Thread Index | Old Index