From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id 3A9023853828 for ; Wed, 12 May 2021 16:04:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3A9023853828 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ldv@altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id BA2EC72C8B4 for ; Wed, 12 May 2021 19:04:50 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id AB94C7CC67A; Wed, 12 May 2021 19:04:50 +0300 (MSK) Date: Wed, 12 May 2021 16:00:00 +0000 From: "Dmitry V. Levin" To: elfutils-devel@sourceware.org Subject: [PATCH] elfcompress: fix exit status in case of an error Message-ID: <20210512160000.GA3462@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2021 16:04:52 -0000 Exit status of 255 in case of an error is probably not what elfcompress users expect, change it to 1. Reported-by: Vitaly Chikunov Fixes: 92acb57eb046 ("elfcompress: New utility.") --- src/ChangeLog | 2 ++ src/elfcompress.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index de130f79..bc6ffc87 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2021-05-12 Dmitry V. Levin + * elfcompress.c (main): Return 1 instead of -1 in case of an error. + * elfcompress.c (process_file): Remove redundant assignment in case of "Nothing to do". diff --git a/src/elfcompress.c b/src/elfcompress.c index 05f3bc2c..dacaff32 100644 --- a/src/elfcompress.c +++ b/src/elfcompress.c @@ -1358,5 +1358,5 @@ main (int argc, char **argv) while (++remaining < argc); free_patterns (); - return result; + return !!result; } -- ldv