From patchwork Fri Dec 10 10:41:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 48767 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B77113857C5F for ; Fri, 10 Dec 2021 10:43:23 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.39]) by sourceware.org (Postfix) with ESMTPS id 398C13857C4F for ; Fri, 10 Dec 2021 10:42:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 398C13857C4F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=schwinge.name Received: from [192.94.31.2] (helo=dem-tschwing-1.ger.mentorg.com) by smtprelay01.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mvdLl-00033M-Ma; Fri, 10 Dec 2021 11:42:01 +0100 Received: (nullmailer pid 3248700 invoked by uid 1000); Fri, 10 Dec 2021 10:41:58 -0000 From: Thomas Schwinge To: libabigail@sourceware.org Subject: [PATCH] abipkgdiff: Respect 'create_abi_file_path' interface Date: Fri, 10 Dec 2021 11:41:50 +0100 Message-Id: <20211210104150.3248635-1-thomas@codesourcery.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Df-Sender: b3V0Z29pbmdAc2Nod2luZ2UubmFtZQ== X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , Cc: Thomas Schwinge Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Currently we may run into this: [...] abipkgdiff: Could not create the directory tree to store the abi for '[...]' abipkgdiff: Writting ABIXML file '' ... abipkgdiff: Wrote ABIXML file '' OK abipkgdiff: Reading ABIXML file '' ... abipkgdiff: Could not read temporary ABIXML file '' ==== Error happened during self check of '[...]' ==== [...] That is, after a failed 'create_abi_file_path', we proceed with an empty 'abi_file_path' -- because that one only gets set "iff the function return true". So we ought to 'return abigail::tools_utils::ABIDIFF_ERROR' in that case. (It's likewise strange why 'create_write_context'/'write_corpus' succeed with an empty 'abi_file_path', but that's for another day...) * tools/abipkgdiff.cc (compare_to_self): Respect 'create_abi_file_path' interface. Signed-off-by: Thomas Schwinge --- tools/abipkgdiff.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git tools/abipkgdiff.cc tools/abipkgdiff.cc index 33efa23a..7fc833b2 100644 --- tools/abipkgdiff.cc +++ tools/abipkgdiff.cc @@ -1583,6 +1583,8 @@ compare_to_self(const elf_file& elf, << "Could not create the directory tree to store the abi for '" << elf.path << "'\n"; + + return abigail::tools_utils::ABIDIFF_ERROR; } ofstream of(abi_file_path.c_str(), std::ios_base::trunc);