linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] coccicheck: return proper error code on check fail
@ 2018-08-10 13:36 efremov
  2018-08-10 13:42 ` Julia Lawall
  2018-08-10 20:25 ` [PATCH v2] coccicheck: return proper error code on fail efremov
  0 siblings, 2 replies; 9+ messages in thread
From: efremov @ 2018-08-10 13:36 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Masahiro Yamada, Luis R . Rodriguez, Nicolas Palix,
	Gilles Muller, Michal Marek, linux-kernel, ldv-project,
	Denis Efremov

If coccicheck finds errors, 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-08-13  7:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10 13:36 [PATCH] coccicheck: return proper error code on check fail efremov
2018-08-10 13:42 ` Julia Lawall
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).