mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Denis Efremov <efremov@linux.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	"Luis R . Rodriguez" <mcgrof@kernel.org>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Michal Marek <michal.lkml@markovi.net>,
	linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org
Subject: Re: [PATCH] coccicheck: return proper error code on check fail
Date: Fri, 10 Aug 2018 15:42:54 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1808101541270.3390@hadrien> (raw)
In-Reply-To: <20180810133636.8340-1-efremov@linux.com>



On Fri, 10 Aug 2018, efremov@linux.com wrote:

> If coccicheck finds errors,

What do you mean by finds errors?  Do you mean that there is an error in
the behavior of coccicheck or that coccicheck finds an error in the source
code?

To put it another way, can you give an example of the kind of error you
are concerned about?

thanks,
julia

> it should return an error code
> distinct from zero. Current code instead of exiting with an
> error code of coccinelle returns error code of
> 'echo "coccicheck failed"' which is almost always equals to zero,
> thus failing original intention of alerting about errors.
> This patch fixes the problem.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  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
>
>

  reply	other threads:[~2018-08-10 13:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-10 13:36 efremov
2018-08-10 13:42 ` Julia Lawall [this message]
2018-08-10 14:20   ` Denis Efremov
2018-08-10 14:28     ` Julia Lawall
2018-08-10 14:45       ` Denis Efremov
2018-08-10 18:23         ` Himanshu Jha
2018-08-10 20:25 ` [PATCH v2] coccicheck: return proper error code on fail efremov
2018-08-10 20:31   ` Julia Lawall
2018-08-13  7:28     ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1808101541270.3390@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=Gilles.Muller@lip6.fr \
    --cc=efremov@linux.com \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®