Module Name: src
Committed By: martin
Date: Sun Dec 10 17:25:30 UTC 2023
Modified Files:
src/usr.bin/systat [netbsd-10]: vmstat.c
Log Message:
Pull up following revision(s) (requested by kre in ticket #489):
usr.bin/systat/vmstat.c: revision 1.92
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).
To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.91.2.1 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.91.2.1
--- src/usr.bin/systat/vmstat.c:1.91 Tue Nov 9 09:19:01 2021
+++ src/usr.bin/systat/vmstat.c Sun Dec 10 17:25:29 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.91 2021/11/09 09:19:01 nia Exp $ */
+/* $NetBSD: vmstat.c,v 1.91.2.1 2023/12/10 17:25:29 martin 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.91.2.1 2023/12/10 17:25:29 martin 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);
}