Skip to content

Commit a19d135

Browse files
SylfrenaJuliaLawall
authored andcommitted
scripts: coccicheck: Improve error feedback when coccicheck fails
Currently, coccicheck fails with only the message "coccicheck failed" and the error code for the failure. To obtain the error logs, one needs to specify a debug file using the DEBUG_FILE option. Modify coccicheck to display error logs when it crashes unless DEBUG_FILE is set, in which case, the error logs are stored in the specified debug file. Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
1 parent 6519a5a commit a19d135

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎scripts/coccicheck‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,14 @@ run_cmd_parmap() {
126126
if [ $VERBOSE -ne 0 ] ; then
127127
echo "Running ($NPROC in parallel): $@"
128128
fi
129-
echo $@ >>$DEBUG_FILE
130-
$@ 2>>$DEBUG_FILE
129+
if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
130+
echo $@>>$DEBUG_FILE
131+
$@ 2>>$DEBUG_FILE
132+
else
133+
echo $@
134+
$@ 2>&1
135+
fi
136+
131137
err=$?
132138
if [[ $err -ne 0 ]]; then
133139
echo "coccicheck failed"

0 commit comments

Comments
 (0)