---
 toys/posix/ps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index faddf685..ea383bfb 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1556,8 +1556,8 @@ static void top_common(
           for (i = 0; i<mix.count; i++)
             run[1+stridx("RSTZ", *string_field(mix.tb[i], &field))]++;
           sprintf(toybuf,
-            "Tasks: %d total,%4ld running,%4ld sleeping,%4ld stopped,"
-            "%4ld zombie", mix.count, run[1], run[2], run[3], run[4]);
+            "%ss: %d total,%4ld running,%4ld sleeping,%4ld
stopped,%4ld zombie",
+            FLAG(H)?"Thread":"Task", mix.count, run[1], run[2],
run[3], run[4]);
           lines = header_line(lines, 0);

           if (readfile("/proc/meminfo", toybuf, sizeof(toybuf))) {
-- 
2.21.0.rc0.258.g878e2cd30e-goog
From 8b06dcdef0724ec8bf9066fc5483440d59d5594a Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Fri, 15 Feb 2019 16:30:56 -0800
Subject: [PATCH] top: differentiate tasks (processes) and threads in the
 header.

---
 toys/posix/ps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index faddf685..ea383bfb 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1556,8 +1556,8 @@ static void top_common(
           for (i = 0; i<mix.count; i++)
             run[1+stridx("RSTZ", *string_field(mix.tb[i], &field))]++;
           sprintf(toybuf,
-            "Tasks: %d total,%4ld running,%4ld sleeping,%4ld stopped,"
-            "%4ld zombie", mix.count, run[1], run[2], run[3], run[4]);
+            "%ss: %d total,%4ld running,%4ld sleeping,%4ld stopped,%4ld zombie",
+            FLAG(H)?"Thread":"Task", mix.count, run[1], run[2], run[3], run[4]);
           lines = header_line(lines, 0);
 
           if (readfile("/proc/meminfo", toybuf, sizeof(toybuf))) {
-- 
2.21.0.rc0.258.g878e2cd30e-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to