aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2016-04-29 14:04:40 -0700
committerRob Landley <rob@landley.net>2016-04-29 18:51:30 -0500
commit151bd1d5adfaad6ece66da3765c0f1c5622b6cca (patch)
tree61cf6340e0ff21941e0988a4df4f3ed457ebd1cd /toys/posix
parent5da354a8378889f54dc75f1514b076e9c2ca1ba4 (diff)
downloadtoybox-151bd1d5adfaad6ece66da3765c0f1c5622b6cca.tar.gz
Show "-" rather 0 if we don't know whether a process is 32- or 64-bit.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/ps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index e56a8e5c..8b35e1c9 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -409,7 +409,7 @@ static char *string_field(struct carveup *tb, struct strawberry *field)
long long *slot = tb->slot, ll = (sl >= 0) ? slot[sl&63] : 0;
// numbers, mostly from /proc/$PID/stat
- if (which <= PS_CPU) {
+ if (which <= PS_BIT) {
char *fmt = "%lld";
if (which==PS_PRI) ll = 39-ll;
@@ -418,7 +418,7 @@ static char *string_field(struct carveup *tb, struct strawberry *field)
else if (which==PS_RSS) ll <<= 2;
else if (which==PS_VSZ) ll >>= 10;
else if (which==PS_PR && ll<-9) fmt="RT";
- else if (which==PS_RTPRIO && ll == 0) fmt="-";
+ else if ((which==PS_RTPRIO || which==PS_BIT) && ll == 0) fmt="-";
sprintf(out, fmt, ll);
// String fields