public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix twice-multifile.sh
@ 2021-03-02 10:10 Tom de Vries
  2021-03-03 23:21 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2021-03-02 10:10 UTC (permalink / raw)
  To: dwz, jakub, mark

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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-03 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 10:10 [PATCH] Fix twice-multifile.sh Tom de Vries
2021-03-03 23:21 ` Mark Wielaard

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).