Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2408)

Issue 5777064: code review 5777064: archive/tar: catch short writes. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by dsymonds
Modified:
12 years, 1 month ago
Reviewers:
rsc
CC:
golang-dev, bradfitz
Visibility:
Public.

Description

archive/tar: catch short writes. Also make error messages consistent throughout.

Patch Set 1 #

Patch Set 2 : diff -r b26cfc77a66c https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r b26cfc77a66c https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 4 : diff -r c7af497373ff https://go.googlecode.com/hg/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -7 lines) Patch
M src/pkg/archive/tar/reader.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/archive/tar/writer.go View 1 3 chunks +13 lines, -4 lines 1 comment Download
M src/pkg/archive/tar/writer_test.go View 1 2 3 4 chunks +7 lines, -2 lines 0 comments Download

Messages

Total messages: 5
dsymonds
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 1 month ago (2012-03-12 06:22:15 UTC) #1
bradfitz
LGTM http://codereview.appspot.com/5777064/diff/2004/src/pkg/archive/tar/writer.go File src/pkg/archive/tar/writer.go (right): http://codereview.appspot.com/5777064/diff/2004/src/pkg/archive/tar/writer.go#newcode53 src/pkg/archive/tar/writer.go:53: tw.err = fmt.Errorf("archive/tar: missed writing %d bytes", tw.nb) ...
12 years, 1 month ago (2012-03-12 06:27:08 UTC) #2
dsymonds
http://codereview.appspot.com/5777064/diff/2004/src/pkg/archive/tar/writer.go File src/pkg/archive/tar/writer.go (right): http://codereview.appspot.com/5777064/diff/2004/src/pkg/archive/tar/writer.go#newcode53 src/pkg/archive/tar/writer.go:53: tw.err = fmt.Errorf("archive/tar: missed writing %d bytes", tw.nb) On ...
12 years, 1 month ago (2012-03-12 06:33:16 UTC) #3
dsymonds
*** Submitted as http://code.google.com/p/go/source/detail?r=7dac9470d5d8 *** archive/tar: catch short writes. Also make error messages consistent throughout. ...
12 years, 1 month ago (2012-03-12 06:33:41 UTC) #4
rsc
12 years, 1 month ago (2012-03-12 17:01:04 UTC) #5
http://codereview.appspot.com/5777064/diff/5001/src/pkg/archive/tar/writer.go
File src/pkg/archive/tar/writer.go (right):

http://codereview.appspot.com/5777064/diff/5001/src/pkg/archive/tar/writer.go...
src/pkg/archive/tar/writer.go:53: tw.err = fmt.Errorf("archive/tar: missed
writing %d bytes", tw.nb)
This seems like a regression.  The code below was already correctly handling
writing zeros if the written data was too short.  Now you are creating a usage
error.  This is an API change.  The old code seems like it was fine.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b