Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp407480imm; Fri, 10 Aug 2018 13:32:53 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy+HFz7Ge4/9WAr9N52eZbxdQ/haHAOW3n/KJwnRr+aMC7g5NKcx/KPwEyPnog5HD+2pYXq X-Received: by 2002:a17:902:8f93:: with SMTP id z19-v6mr7317900plo.241.1533933173508; Fri, 10 Aug 2018 13:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533933173; cv=none; d=google.com; s=arc-20160816; b=Q+S5EDMSmVHXQ2Ud/gqTT0v8CdshrhN4+4MIKE0sjCRGJuNrEXwjpXSbQhMRHC41Py uI4I4x8JDBuqIjAXo/I3Y3lsy2CfE2d3x4v+9Mfsf+9lq52WkUY383ENfIUDr9rPBizh OExlUctPLupaTgFNLJN5ZJn9R/2T+1VYfJ6E4MvCgHpPlDqNWb6Pk+d22U8UdW2bC/Rc 806b0FVCeEHCMhRjlxgzBUqtqxoHp8llDAdQ3nlVK9sd4l70qnVMs4DvLgfxO+a+W9Ms P50b6Ss39WbYcF1V21Rd664hYSGHbxBUmv+h1rT0r99HUmPxPY0NfTBXEZzChWljeKUW O5Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=DD+uaYEDpI4B+isrQg7IPXVQNFcfgdZM0wI+SEL4mRY=; b=E4x9ythC5UyM+WAfmLXrcSci7eSpw/Dm74LTTJ4vkzzV4BnTgrlHAk3Gkjmve8F4By 8mT1PRIN849dVDob7ScL5WqnntmTbZ3wuEbWZ7kohEw+/jFlOsZilmVxUtOeIMQXI3AA At5xk1ZFx6kJApdYM36+iLdog8n/+FbTVHLfh8+5R9tIscGw9APKIGg13DGtTP92+36L DIalvlfXxeGqziX2KFlXIIUie4hyMNdJ4ryA0C5Lv+MeuATT/T7sOdFoVTceWZZV6LBl rzaUIeIge3E/2yzKImEo5yyMfclrzofcmuhIqkd/gogdP2gYV34Zeu1PGrnTnnVj2AJa Y5FA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w135-v6si11662705pff.8.2018.08.10.13.32.37; Fri, 10 Aug 2018 13:32:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727204AbeHJXDM (ORCPT + 99 others); Fri, 10 Aug 2018 19:03:12 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:10986 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbeHJXDM (ORCPT ); Fri, 10 Aug 2018 19:03:12 -0400 X-IronPort-AV: E=Sophos;i="5.53,221,1531778400"; d="scan'208";a="342083293" Received: from abo-214-111-68.mrs.modulonet.fr (HELO [192.168.0.15]) ([85.68.111.214]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Aug 2018 22:31:42 +0200 Date: Fri, 10 Aug 2018 22:31:41 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Denis Efremov cc: Masahiro Yamada , "Luis R . Rodriguez" , Nicolas Palix , Gilles Muller , Michal Marek , linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH v2] coccicheck: return proper error code on fail In-Reply-To: <20180810202555.11034-1-efremov@linux.com> Message-ID: References: <20180810133636.8340-1-efremov@linux.com> <20180810202555.11034-1-efremov@linux.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Aug 2018, efremov@linux.com wrote: > From: Denis Efremov > > 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 OK, I get it now. Thanks. Acked-by: Julia Lawall > --- > 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 > >