Module Name:    src
Committed By:   martin
Date:           Mon Dec 11 12:28:06 UTC 2023

Modified Files:
        src/usr.bin/systat [netbsd-9]: vmstat.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1777):

        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.87 -r1.87.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.87 src/usr.bin/systat/vmstat.c:1.87.2.1
--- src/usr.bin/systat/vmstat.c:1.87	Sun Jun 30 19:57:23 2019
+++ src/usr.bin/systat/vmstat.c	Mon Dec 11 12:28:06 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmstat.c,v 1.87 2019/06/30 19:57:23 he Exp $	*/
+/*	$NetBSD: vmstat.c,v 1.87.2.1 2023/12/11 12:28:06 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.87 2019/06/30 19:57:23 he Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.87.2.1 2023/12/11 12:28:06 martin Exp $");
 #endif /* not lint */
 
 /*
@@ -725,19 +725,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);
 }
 

Reply via email to