aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-01-25 05:09:42 (GMT)
committerElliott Hughes <enh@google.com>2018-01-25 05:09:42 (GMT)
commite77711bf8041a58e15ab2ec89c98bff02d81597e (patch)
treefef59256674c677e0018b90edf6eca86cb1daabc
parentaf478b798ef0baea3d453ab267abc017b9a79627 (diff)
parent03b83ee148b62fe56aa834a0e0c96352d34ef587 (diff)
downloadandroid_external_toybox-e77711bf8041a58e15ab2ec89c98bff02d81597e.zip
android_external_toybox-e77711bf8041a58e15ab2ec89c98bff02d81597e.tar.gz
android_external_toybox-e77711bf8041a58e15ab2ec89c98bff02d81597e.tar.bz2
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I2e776e6091f09fed27fa83715d8f46460c75b73f
-rwxr-xr-xtests/losetup.test4
-rw-r--r--toys/posix/ps.c7
2 files changed, 4 insertions, 7 deletions
diff --git a/tests/losetup.test b/tests/losetup.test
index 651c693..c929250 100755
--- a/tests/losetup.test
+++ b/tests/losetup.test
@@ -13,8 +13,8 @@ fi
truncate -s 1M blah.img &&
FILE="$(readlink -f blah.img)"
-DEV="$(printf '%04d' $(stat -t blah.img | awk '{print $7}'))"
-NODE="$(awk '{print $7}')"
+DEV="$(printf '%04s' $(stat -t blah.img | awk '{print $7}'))"
+NODE="$(stat -t blah.img | awk '{print $8}')"
losetup -f
losetup -f -s
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 7741dcd..fd9b54b 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -680,11 +680,8 @@ static int get_ps(struct dirtree *new)
memset(slot, 0, sizeof(tb->slot));
tb->slot[SLOT_tid] = *slot = atol(new->name);
- 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;
- }
+ if (TT.threadparent && TT.threadparent->extra)
+ if (*slot == *(((struct carveup *)TT.threadparent->extra)->slot)) return 0;
fd = dirtree_parentfd(new);
len = 2048;