$! is not set after ( cmd & )
This bug was introduced by commit 49010e502a74c ("Replace pushd // popd
with cd calls.").
Since we create a sub-shell in test_proc_kill only to preserve PWD,
let's change this to cd $OLDPWD. In contrast to pushd/popd this will
work in busybox.
Signed-off-by: Vladimir Davydov <[email protected]>
---
testcases/kernel/controllers/memcg/control/memcg_control_test.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
b/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
index fa50516ba71b..168efe3ee35c 100644
--- a/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
+++ b/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
@@ -54,7 +54,9 @@ FAIL=1
# Check if the test process is killed on crossing boundary
test_proc_kill()
{
- ( cd $TMP && mem_process -m $PROC_MEM & )
+ cd $TMP
+ mem_process -m $PROC_MEM &
+ cd $OLDPWD
sleep 1
echo $! > tasks
--
2.1.4
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list