lkml.org 
[lkml]   [2018]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] coccicheck: return proper error code on fail
2018-08-11 5:31 GMT+09:00 Julia Lawall <julia.lawall@lip6.fr>:
>
>
> On Fri, 10 Aug 2018, efremov@linux.com wrote:
>
>> From: Denis Efremov <efremov@linux.com>
>>
>> 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 <efremov@linux.com>
>
> OK, I get it now. Thanks.
>
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>
>


Applied to linux-kbuild. Thanks!


>> ---
>> scripts/coccicheck | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/coccicheck b/scripts/coccicheck
>> index 9fedca611b7f..e04d328210ac 100755
>> --- a/scripts/coccicheck
>> +++ b/scripts/coccicheck
>> @@ -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
>> }
>>
>> --
>> 2.17.1
>>
>>



--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2018-08-13 09:29    [W:1.297 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site