Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Dec 2011 20:36:00 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r228749 - head/usr.bin/tar
Message-ID:  <201112202036.pBKKa0Bn033983@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Tue Dec 20 20:36:00 2011
New Revision: 228749
URL: http://svn.freebsd.org/changeset/base/228749

Log:
  Sync bsdtar with vendor branch release/2.8:
  
  Revision 3769:
  Merge r3744 from trunk:  Correctly return errors when reading
  an archive using @archive extension.
  
  Obtained from:	http://code.google.com/p/libarchive
  MFC after:	2 weeks

Modified:
  head/usr.bin/tar/write.c

Modified: head/usr.bin/tar/write.c
==============================================================================
--- head/usr.bin/tar/write.c	Tue Dec 20 20:34:02 2011	(r228748)
+++ head/usr.bin/tar/write.c	Tue Dec 20 20:36:00 2011	(r228749)
@@ -592,7 +592,7 @@ append_archive(struct bsdtar *bsdtar, st
 	struct archive_entry *in_entry;
 	int e;
 
-	while (0 == archive_read_next_header(ina, &in_entry)) {
+	while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) {
 		if (!new_enough(bsdtar, archive_entry_pathname(in_entry),
 			archive_entry_stat(in_entry)))
 			continue;
@@ -630,8 +630,7 @@ append_archive(struct bsdtar *bsdtar, st
 			fprintf(stderr, "\n");
 	}
 
-	/* Note: If we got here, we saw no write errors, so return success. */
-	return (0);
+	return (e == ARCHIVE_EOF ? ARCHIVE_OK : e);
 }
 
 /* Helper function to copy data between archives. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112202036.pBKKa0Bn033983>