mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic/014: Fix wrong return value in output
Current code always output "truncfile returned 0" because $? was modified by previous command. Use $ret to indicate the correct return value from truncfile. [dchinner: fix formatting issues, update commit message.] Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
+4
-3
@@ -61,10 +61,11 @@ echo "brevity is wit..."
|
||||
echo "------"
|
||||
echo "test 1"
|
||||
echo "------"
|
||||
if ! src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1
|
||||
then
|
||||
src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1
|
||||
ret=$?
|
||||
if [ "$ret" -ne 0 ]; then
|
||||
out=`cat $tmp.out`
|
||||
echo "truncfile returned $? : \"$out\""
|
||||
echo "truncfile returned $ret : \"$out\""
|
||||
else
|
||||
echo "OK"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user