diff options
author | Sumera Priyadarsini <sylphrenadin@gmail.com> | 2020-09-13 14:05:48 +0200 |
---|---|---|
committer | Julia Lawall <Julia.Lawall@lip6.fr> | 2020-09-13 22:13:01 +0200 |
commit | a19d1358345e040af9164ee7dd0f39ea0a99d565 (patch) | |
tree | 32e86b80bb7fb1cb05d538953fed45b15e9a21b4 /scripts/coccicheck | |
parent | coccinelle: api: update kzfree script to kfree_sensitive (diff) | |
download | linux-a19d1358345e040af9164ee7dd0f39ea0a99d565.tar.xz linux-a19d1358345e040af9164ee7dd0f39ea0a99d565.zip |
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>
Diffstat (limited to 'scripts/coccicheck')
-rwxr-xr-x | scripts/coccicheck | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck index 6e37cf36caae..85136f4fe970 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -126,8 +126,14 @@ run_cmd_parmap() { if [ $VERBOSE -ne 0 ] ; then echo "Running ($NPROC in parallel): $@" fi - echo $@ >>$DEBUG_FILE - $@ 2>>$DEBUG_FILE + if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then + echo $@>>$DEBUG_FILE + $@ 2>>$DEBUG_FILE + else + echo $@ + $@ 2>&1 + fi + err=$? if [[ $err -ne 0 ]]; then echo "coccicheck failed" |