Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jul 2018 17:20:27 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336174 - head/usr.bin/top
Message-ID:  <201807101720.w6AHKRiV089600@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Jul 10 17:20:27 2018
New Revision: 336174
URL: https://svnweb.freebsd.org/changeset/base/336174

Log:
  Fix thread state summary line display after r334918.

Modified:
  head/usr.bin/top/display.c

Modified: head/usr.bin/top/display.c
==============================================================================
--- head/usr.bin/top/display.c	Tue Jul 10 17:01:19 2018	(r336173)
+++ head/usr.bin/top/display.c	Tue Jul 10 17:20:27 2018	(r336174)
@@ -347,12 +347,12 @@ i_procstates(int total, int *brkdn)
     procstates_buffer = setup_buffer(procstates_buffer, 0);
 
     /* write current number of processes and remember the value */
-    printf("%d %s:", total, (ps.thread) ? "threads" :"processes");
+    printf("%d %s:", total, ps.thread ? "threads" : "processes");
     ltotal = total;
 
     /* put out enough spaces to get to column 15 */
     i = digits(total);
-    while (i++ < 4)
+    while (i++ < (ps.thread ? 6 : 4))
     {
 	putchar(' ');
     }
@@ -389,10 +389,10 @@ else {
 	/* if number of digits differs, rewrite the label */
 	if (digits(total) != digits(ltotal))
 	{
-	    fputs(" processes:", stdout);
+	    printf(" %s:", ps.thread ? "threads" : "processes");
 	    /* put out enough spaces to get to column 15 */
 	    i = digits(total);
-	    while (i++ < 4)
+	    while (i++ < (ps.thread ? 6 : 4))
 	    {
 		putchar(' ');
 	    }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807101720.w6AHKRiV089600>