summaryrefslogtreecommitdiff
path: root/usr.bin/top/top.c
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2019-10-08 20:51:04 +0000
committerkn <kn@cvs.openbsd.org>2019-10-08 20:51:04 +0000
commitb877879398fe17665b2a9000ce227c1e5407a0ac (patch)
treee4fbf37015597bd42a584e9602997c2876b1f71f /usr.bin/top/top.c
parentf3a87abdc8a4d4ed4a13885173f0a789790fb420 (diff)
Simplify threads flag handling
Instead of always passing the threads flag which decides whether other function arguments are used or not, make callers pass those arguments or NULL depending on the threads flag. This reflects better how thread IDs are shown in place of user names/IDs. OK millert
Diffstat (limited to 'usr.bin/top/top.c')
-rw-r--r--usr.bin/top/top.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 66e6e618a3b..d12ed68b1d5 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.100 2019/10/08 07:26:59 kn Exp $ */
+/* $OpenBSD: top.c,v 1.101 2019/10/08 20:51:03 kn Exp $ */
/*
* Top users/processes display for Unix
@@ -531,7 +531,7 @@ restart:
i_message();
/* get the string to use for the process area header */
- header_text = format_header(uname_field, ps.threads);
+ header_text = format_header(ps.threads ? NULL : uname_field);
/* update the header area */
i_header(header_text);
@@ -562,8 +562,8 @@ restart:
pid_t pid;
char * s;
- s = format_next_process(processes, get_userid,
- &pid, ps.threads);
+ s = format_next_process(processes,
+ ps.threads ? NULL : get_userid, &pid);
i_process(i, s, pid == hlpid);
}
}