OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a75364e
)
Fix "ps -T 1234" to show thread belonging to that PID.
author
Rob Landley
<rob@landley.net>
Tue, 16 Jan 2018 03:46:45 +0000
(21:46 -0600)
committer
Rob Landley
<rob@landley.net>
Tue, 16 Jan 2018 03:46:45 +0000
(21:46 -0600)
toys/posix/ps.c
patch
|
blob
|
history
diff --git
a/toys/posix/ps.c
b/toys/posix/ps.c
index
fd9b54b
..
7741dcd
100644
(file)
--- a/
toys/posix/ps.c
+++ b/
toys/posix/ps.c
@@
-680,8
+680,11
@@
static int get_ps(struct dirtree *new)
memset(slot, 0, sizeof(tb->slot));
tb->slot[SLOT_tid] = *slot = atol(new->name);
memset(slot, 0, sizeof(tb->slot));
tb->slot[SLOT_tid] = *slot = atol(new->name);
- if (TT.threadparent && TT.threadparent->extra)
- if (*slot == *(((struct carveup *)TT.threadparent->extra)->slot)) return 0;
+ if (TT.threadparent && TT.threadparent->extra) {
+ *slot = *(((struct carveup *)TT.threadparent->extra)->slot);
+ // Parent also shows up as a thread, discard duplicate
+ if (*slot == tb->slot[SLOT_tid]) return 0;
+ }
fd = dirtree_parentfd(new);
len = 2048;
fd = dirtree_parentfd(new);
len = 2048;