Module Name: src
Committed By: kre
Date: Tue Mar 28 00:00:30 UTC 2023
Modified Files:
src/usr.bin/systat: vmstat.c
Log Message:
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).
To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/systat/vmstat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/systat/vmstat.c
diff -u src/usr.bin/systat/vmstat.c:1.91 src/usr.bin/systat/vmstat.c:1.92
--- src/usr.bin/systat/vmstat.c:1.91 Tue Nov 9 09:19:01 2021
+++ src/usr.bin/systat/vmstat.c Tue Mar 28 00:00:30 2023
@@ -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);
}