Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 May 2010 13:47:59 -0700
From:      Tim Kientzle <kientzle@freebsd.org>
To:        Anonymous <swell.k@gmail.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r207790 - head/usr.bin/tar
Message-ID:  <4BF059FF.8050002@freebsd.org>
In-Reply-To: <86aas3oc8b.fsf@gmail.com>
References:  <201005081628.o48GSM9s067363__30886.3841965378$1273336146$gmane$org@svn.freebsd.org> <86aas3oc8b.fsf@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------040200080200060400000804
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Please try the attached patch and let me know if it fixes it for you...

Cheers,

Tim

Anonymous wrote:
> Tim Kientzle <kientzle@FreeBSD.org> writes:
> 
>> Author: kientzle
>> Date: Sat May  8 16:28:22 2010
>> New Revision: 207790
>> URL: http://svn.freebsd.org/changeset/base/207790
>>
>> Log:
>>   Config updates.
>>
>> Modified:
>>   head/usr.bin/tar/config_freebsd.h
> 
> Smth broke after this commit. Hitting ^T causes ports to barf errors.
> 
> before
> 
>     x11-toolkits/wxgtk28 $ make BATCH= patch
>     ===>  Extracting for wxgtk2-2.8.10_4
>     => MD5 Checksum OK for wxGTK-2.8.10.tar.bz2.
>     => SHA256 Checksum OK for wxGTK-2.8.10.tar.bz2.
>     load: 0.05  cmd: sh 64229 [running] 0.00r 0.00u 0.00s 0% 1576k
>     load: 0.05  cmd: bzip2 64231 [running] 0.19r 0.16u 0.00s 2% 4564k
>     load: 0.05  cmd: bsdtar 64232 [running] 0.36r 0.00u 0.13s 1% 2420k
>     load: 0.05  cmd: bzip2 64231 [running] 0.56r 0.47u 0.00s 4% 4568k
>     load: 0.05  cmd: bsdtar 64232 [running] 1.82r 0.05u 0.62s 6% 2448k
>     ===>  Patching for wxgtk2-2.8.10_4
>     ===>  Applying FreeBSD patches for wxgtk2-2.8.10_4
> 
> after
> 
>     x11-toolkits/wxgtk28 $ make BATCH= patch
>     load: 0.05  cmd: make 63587 [zio->io_cv)] 0.19r 0.03u 0.00s 0% 1268k
>     ===>  Extracting for wxgtk2-2.8.10_4
>     load: 0.05  cmd: awk 63621 [zio->io_cv)] 0.01r 0.00u 0.00s 0% 1492k
>     => MD5 Checksum OK for wxGTK-2.8.10.tar.bz2.
>     => SHA256 Checksum OK for wxGTK-2.8.10.tar.bz2.
>     load: 0.05  cmd: bzip2 63631 [running] 0.13r 0.10u 0.00s 1% 4564k
>     wxGTK-2.8.10/contrib/include/wx/fl/controlbar.h: Error reading stdin
>     load: 0.05  cmd: bzip2 63631 [running] 0.34r 0.30u 0.00s 3% 4568k
>     tar: Error exit delayed from previous errors.
>     *** Error code 1
> 
> Looks like errors are related to extracting from stdin.
> 
>     $ bzip2 -dc wxGTK-2.8.10.tar.bz2 | tar xf -
>     load: 0.04  cmd: bzip2 65117 [running] 0.17r 0.07u 0.00s 0% 4564k
>     tar: Error reading stdin
>     load: 0.04  cmd: bzip2 65117 [running] 0.33r 0.23u 0.00s 2% 4568k
>     tar: Error exit delayed from previous errors.
>     zsh: broken pipe  bzip2 -dc wxGTK-2.8.10.tar.bz2 |
>     zsh: exit 1       tar xf -
> 
> 

--------------040200080200060400000804
Content-Type: text/x-patch;
 name="libarchive_retry_eintr.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="libarchive_retry_eintr.patch"

Index: archive_read_open_fd.c
===================================================================
--- archive_read_open_fd.c	(revision 208162)
+++ archive_read_open_fd.c	(working copy)
@@ -116,11 +116,15 @@
 	ssize_t bytes_read;
 
 	*buff = mine->buffer;
-	bytes_read = read(mine->fd, mine->buffer, mine->block_size);
-	if (bytes_read < 0) {
-		archive_set_error(a, errno, "Error reading fd %d", mine->fd);
+	for (;;) {
+		bytes_read = read(mine->fd, mine->buffer, mine->block_size);
+		if (bytes_read < 0) {
+			if (errno == EINTR)
+				continue;
+			archive_set_error(a, errno, "Error reading fd %d", mine->fd);
+		}
+		return (bytes_read);
 	}
-	return (bytes_read);
 }
 
 #if ARCHIVE_API_VERSION < 2
Index: archive_read_open_filename.c
===================================================================
--- archive_read_open_filename.c	(revision 208162)
+++ archive_read_open_filename.c	(working copy)
@@ -160,15 +160,19 @@
 	ssize_t bytes_read;
 
 	*buff = mine->buffer;
-	bytes_read = read(mine->fd, mine->buffer, mine->block_size);
-	if (bytes_read < 0) {
-		if (mine->filename[0] == '\0')
-			archive_set_error(a, errno, "Error reading stdin");
-		else
-			archive_set_error(a, errno, "Error reading '%s'",
-			    mine->filename);
+	for (;;) {
+		bytes_read = read(mine->fd, mine->buffer, mine->block_size);
+		if (bytes_read < 0) {
+			if (errno == EINTR)
+				continue;
+			else if (mine->filename[0] == '\0')
+				archive_set_error(a, errno, "Error reading stdin");
+			else
+				archive_set_error(a, errno, "Error reading '%s'",
+				    mine->filename);
+		}
+		return (bytes_read);
 	}
-	return (bytes_read);
 }
 
 #if ARCHIVE_API_VERSION < 2

--------------040200080200060400000804--



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