tools: Remove the temp variable in checking program exit code

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-04-19 16:58:55 +08:00 committed by patacongo
parent cf674ed51c
commit 5c1497aeb1
2 changed files with 8 additions and 16 deletions

View File

@ -42,17 +42,13 @@ usage() {
} }
check_file() { check_file() {
$TOOLDIR/nxstyle $@ 2>&1 if ! $TOOLDIR/nxstyle $@ 2>&1; then
ret=$? fail=1
if [ $ret != 0 ]; then
fail=$ret
fi fi
if [ $spell != 0 ]; then if [ $spell != 0 ]; then
codespell -q 7 ${@: -1} if ! codespell -q 7 ${@: -1}; then
ret=$? fail=1
if [ $ret != 0 ]; then
fail=$ret
fi fi
fi fi
} }
@ -83,10 +79,8 @@ check_ranges() {
} }
check_patch() { check_patch() {
git apply --check $1 if ! git apply --check $1; then
ret=$? fail=1
if [ $ret != 0 ]; then
fail=$ret
else else
git apply $1 git apply $1
diffs=`cat $1` diffs=`cat $1`

View File

@ -158,10 +158,8 @@ blacklist=`grep "^-" $testfile || true`
cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
function makefunc { function makefunc {
${MAKE} ${MAKE_FLAGS} "${EXTRA_FLAGS}" $@ 1>/dev/null if ! ${MAKE} ${MAKE_FLAGS} "${EXTRA_FLAGS}" $@ 1>/dev/null; then
ret=$? fail=1
if [ $ret != 0 ]; then
fail=$ret
fi fi
} }