From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BC07C43334 for ; Fri, 17 Jun 2022 09:25:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380973AbiFQJZF (ORCPT ); Fri, 17 Jun 2022 05:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233270AbiFQJZD (ORCPT ); Fri, 17 Jun 2022 05:25:03 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B41D15F26A; Fri, 17 Jun 2022 02:25:02 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R411e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0VGeLYMR_1655457896; Received: from 30.240.100.35(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0VGeLYMR_1655457896) by smtp.aliyun-inc.com; Fri, 17 Jun 2022 17:24:58 +0800 Message-ID: Date: Fri, 17 Jun 2022 17:24:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2] sign-file: Fix confusing error messages Content-Language: en-US To: Jarkko Sakkinen References: <20210624104824.82616-1-tianjia.zhang@linux.alibaba.com> Cc: David Howells , David Woodhouse , Herbert Xu , "David S. Miller" , Eric Biggers , Eric Biggers , Mimi Zohar , Vitaly Chikunov , Gilad Ben-Yossef , Pascal van Leeuwen , James Morris , James Morris , keyrings@vger.kernel.org, linux-kernel@vger.kernel.org From: Tianjia Zhang In-Reply-To: <20210624104824.82616-1-tianjia.zhang@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jarkko, On 6/24/21 6:48 PM, Tianjia Zhang wrote: > When an error occurs, use errx() instead of err() to display the > error message, because openssl has its own error record. When an > error occurs, errno will not be changed, while err() displays the > errno error message. It will cause confusion. For example, when > CMS_add1_signer() fails, the following message will appear: > > sign-file: CMS_add1_signer: Success > > errx() ignores errno and does not cause such issue. > > Signed-off-by: Tianjia Zhang > --- > scripts/sign-file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/sign-file.c b/scripts/sign-file.c > index fbd34b8e8f57..37d8760cb0d1 100644 > --- a/scripts/sign-file.c > +++ b/scripts/sign-file.c > @@ -107,7 +107,7 @@ static void drain_openssl_errors(void) > bool __cond = (cond); \ > display_openssl_errors(__LINE__); \ > if (__cond) { \ > - err(1, fmt, ## __VA_ARGS__); \ > + errx(1, fmt, ## __VA_ARGS__); \ > } \ > } while(0) > Likewise, No response from David, can you pick this? thanks. Best regards, Tianjia