From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35660 invoked by alias); 4 Mar 2019 16:48:48 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 35633 invoked by uid 89); 4 Mar 2019 16:48:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy=honour, Hx-languages-length:1475 X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Tue, 01 Jan 2019 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [PATCH] Honour errors when processing more than one file Message-ID: <20190304164925.GA27794@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-q1/txt/msg00069.txt.bz2 Hi, When using dwz -L0 on a hello world a.out, it fails: ... $ dwz -L0 a.out $ echo $? 1 ... But when we do the same for a.out and a copy b.out, it passes: ... $ cp a.out b.out $ dwz -L0 a.out b.out $ echo $? 0 ... Fix this by honouring dwz return codes when processing more than one file. OK for trunk? Thanks, - Tom Honour errors when processing more than one file 2019-03-04 Tom de Vries PR dwz/24301 * dwz.c (main): Handle dwz returning 1 if processing more than one file. * testsuite/dwz.tests/two-files-too-many-dies.sh: New test. --- dwz.c | 2 ++ testsuite/dwz.tests/two-files-too-many-dies.sh | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/dwz.c b/dwz.c index d348418..0c53c4b 100644 --- a/dwz.c +++ b/dwz.c @@ -11940,6 +11940,8 @@ main (int argc, char *argv[]) } else if (resa[i - optind].res == 0) successcount++; + if (thisret == 1) + return 1; if (hardlink && resa[i - optind].res >= 0 && resa[i - optind].nlink > 1) diff --git a/testsuite/dwz.tests/two-files-too-many-dies.sh b/testsuite/dwz.tests/two-files-too-many-dies.sh new file mode 100755 index 0000000..7214ff6 --- /dev/null +++ b/testsuite/dwz.tests/two-files-too-many-dies.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +cp ../hello 1 +cp ../hello 2 + +if dwz -L0 1 2 2>/dev/null; then + exit 1 +fi + +cmp 1 ../hello +cmp 2 ../hello + +ls=$(ls) +ls=$(echo $ls) +[ "$ls" = "1 2" ] + +rm -f 1 2