From owner-svn-src-all@FreeBSD.ORG Sat May 22 20:24:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A640B1065673; Sat, 22 May 2010 20:24:59 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id AA4358FC08; Sat, 22 May 2010 20:24:58 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so1170178fgb.13 for ; Sat, 22 May 2010 13:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=3sc2Y9W5CVTcr0R46Y4un0lFQ8t+tlLyijSRtGW+mM8=; b=a1Z3fTjOs0CZehxxqkszaxJMhJA65wHxiaNnOB7Qe+y3Xzkcn+vQk0vihgu15tjoEB 4BgEAIKlacqwk6K21OFvVNjk+F5g7kzPSySa8HcgftGOPxuyOG/GlCUCzXmqinS2ejds M3DH559P3/2zTq03D6WlpOzH1rMzEcv3l86+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=XNQ8leq6nF7V+Z/t+6UuB6Lu9iC8IZXrcrz7JRebXJHnB4Adjyu8O1W4o0FEwA5EqT G134NAVdPsryYQy3YMd0t2g5lg4tlXLGhJSGFmDPzV83LpUeSqjQbAZ4z5lLrhutMK5r LjWSLcH7h1k/KkvvgLacgYeFdnnpHpiWNDLpY= Received: by 10.87.50.37 with SMTP id c37mr5820011fgk.68.1274559894898; Sat, 22 May 2010 13:24:54 -0700 (PDT) Received: from localhost (95-25-188-72.broadband.corbina.ru [95.25.188.72]) by mx.google.com with ESMTPS id 3sm1705526fge.20.2010.05.22.13.24.54 (version=SSLv3 cipher=RC4-MD5); Sat, 22 May 2010 13:24:54 -0700 (PDT) From: Anonymous To: Tim Kientzle References: <201005081628.o48GSM9s067363__30886.3841965378$1273336146$gmane$org@svn.freebsd.org> <86aas3oc8b.fsf@gmail.com> <4BF059FF.8050002__30617.9139217877$1274042897$gmane$org@freebsd.org> <861vdaakkf.fsf@gmail.com> <86mxvsxtjh.fsf@gmail.com> <4BF811C2.4050901@freebsd.org> Date: Sun, 23 May 2010 00:24:35 +0400 In-Reply-To: <4BF811C2.4050901@freebsd.org> (Tim Kientzle's message of "Sat, 22 May 2010 10:17:54 -0700") Message-ID: <868w7bd6rg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207790 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2010 20:24:59 -0000 Tim Kientzle writes: > Ah, yes. I did forget to add an EINTR check to the write side. > > Attached patch should fix "tar cf" > > Thanks for your careful testing... > [...] > Index: archive_write.c > =================================================================== > --- archive_write.c (revision 2413) > +++ archive_write.c (working copy) > @@ -361,11 +361,20 @@ > remaining -= to_copy; > /* ... if it's full, write it out. */ > if (state->avail == 0) { > - bytes_written = (a->client_writer)(&a->archive, > - a->client_data, state->buffer, state->buffer_size); > - if (bytes_written <= 0) > - return (ARCHIVE_FATAL); > - /* XXX TODO: if bytes_written < state->buffer_size */ > + char *p = state->buffer; > + size_t remaining = state->buffer_size; > + while (remaining > 0) { > + bytes_written = (a->client_writer)(&a->archive, > + a->client_data, p, remaining); > + if (bytes_written <= 0) > + return (ARCHIVE_FATAL); > + if (bytes_remaining > remaining) { > + archive_set_error(a, -1, "write overrun"); > + return (ARCHIVE_FATAL); > + } > + p += bytes_written; > + remaining -= bytes_written; > + } > state->next = state->buffer; > state->avail = state->buffer_size; > } This hunk doesn't apply against archive_write.c@r201099. It depends on r1936 from googlecode that wasn't merged to /head. I compiled without the above hunk and I no longer able to reproduce the issue. Thanks.