Skip to content

Commit

Permalink
coccicheck: return proper error code on fail
Browse files Browse the repository at this point in the history
If coccicheck fails, it should return an error code distinct from zero
to signal about an internal problem. Current code instead of exiting with
the tool's error code returns the error code of 'echo "coccicheck failed"'
which is almost always equals to zero, thus failing the original intention
of alerting about a problem. This patch fixes the code.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
evdenis authored and masahir0y committed Aug 13, 2018
1 parent 09d4d96 commit 512ddf7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/coccicheck
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ run_cmd_parmap() {
fi
echo $@ >>$DEBUG_FILE
$@ 2>>$DEBUG_FILE
if [[ $? -ne 0 ]]; then
err=$?
if [[ $err -ne 0 ]]; then
echo "coccicheck failed"
exit $?
exit $err
fi
}

Expand Down

0 comments on commit 512ddf7

Please sign in to comment.