public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org
Subject: [PATCH] Fix twice-multifile.sh
Date: Tue, 2 Mar 2021 11:10:43 +0100	[thread overview]
Message-ID: <20210302101042.GA24040@delia> (raw)

Hi,

After "Clean up temporary file in hardlink mode", test-case twice-multifile.sh
started failing.

The test-case first dwz-compresses files 1 and 2 in single-file mode.
Then it attempts a dwz -m 3 1 2.

This results in a res.res value of 1 (processed, unchanged) for both files.

This causes the files not to be counted as a success in main, and multifile
mode optimization is skipped.

Fix this by handling res.res == 1 in main.

Any comments?

Thanks,
- Tom

Fix twice-multifile.sh

2021-03-02  Tom de Vries  <tdevries@suse.de>

	* dwz.c (main): Handle res.res == 1.

---
 dwz.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dwz.c b/dwz.c
index 96f292d..af1c5af 100644
--- a/dwz.c
+++ b/dwz.c
@@ -16809,10 +16809,10 @@ main (int argc, char *argv[])
 	      thisret = dwz (file, NULL, &resa[i - optind],
 			     hardlinks ? resa : NULL, &argv[optind]);
 	    }
-	  else if (resa[i - optind].res == 0)
-	    successcount++;
 	  else if (thisret == 1)
 	    ret = 1;
+	  else if (resa[i - optind].res >= 0)
+	    successcount++;
 	  if (hardlink
 	      && resa[i - optind].res >= 0
 	      && resa[i - optind].nlink > 1)
@@ -16851,8 +16851,7 @@ main (int argc, char *argv[])
 		  multifile_mode = MULTIFILE_MODE_FI;
 		  /* Don't process again files that couldn't
 		     be processed successfully.  */
-		  if (resa[i - optind].res == -1
-		      || resa[i - optind].res == 1)
+		  if (resa[i - optind].res == -1)
 		    continue;
 		  for (cu = alt_first_cu; cu; cu = cu->cu_next)
 		    alt_clear_dups (cu->cu_die);

             reply	other threads:[~2021-03-02 10:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 10:10 Tom de Vries [this message]
2021-03-03 23:21 ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210302101042.GA24040@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).