Skip to content

Commit 301022b

Browse files
Hao Zengpevik
authored andcommitted
controllers :Fix the failure of shell script to get path
Use -r in shell builtin read. This fixes errors in controllers shell scripts (because backslash is part of the line and should not be unescaped): /opt/ltp/testcases/bin/cpuset_funcs.sh:line178: /dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7/tasks: The file or directory is not available rmdir: delete '/dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7' Failure: The file or directory is not available cpuset_memory_pressure 1 TFAIL: Couldn't remove subdir - /opt/ltp/testcases/bin/cpuset_funcs.sh:line178: /dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7/tasks: The file or directory is not available rmdir: delete '/dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7' Failure: The file or directory is not available cpuset_memory_pressure 1 TFAIL: Couldn't remove subdir - Link: https://lore.kernel.org/ltp/[email protected]/ Reviewed-by: Petr Vorel <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]> Signed-off-by: Hao Zeng <[email protected]> [ pvorel: reword commit log ] Signed-off-by: Petr Vorel <[email protected]>
1 parent 533af03 commit 301022b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cleanup()
6363
return 0
6464
}
6565

66-
find $CPUCTL -type d | sort | sed -n '2,$p' | tac | while read tmpdir
66+
find $CPUCTL -type d | sort | sed -n '2,$p' | tac | while read -r tmpdir
6767
do
6868
while read tmppid
6969
do

testcases/kernel/controllers/cpuset/cpuset_funcs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ cleanup()
184184
echo $CHILDREN_VALUE > $CLONE_CHILDREN
185185
echo $SCHED_LB_VALUE > $SCHED_LB
186186

187-
find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read subdir
187+
find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read -r subdir
188188
do
189189
while read pid
190190
do

0 commit comments

Comments
 (0)