Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: File.Write cannot return io.ErrShortWrite #20386

Closed
dominikh opened this issue May 17, 2017 · 2 comments
Closed

os: File.Write cannot return io.ErrShortWrite #20386

dominikh opened this issue May 17, 2017 · 2 comments

Comments

@dominikh
Copy link
Member

@dominikh dominikh commented May 17, 2017

What version of Go are you using (go version)?

go version devel +13cdd814ea Tue May 16 21:01:42 2017 +0000 linux/amd64

(*os.File).Write is supposed to return an error on short writes. The assignment in

err = io.ErrShortWrite
however has no effect, because e is the error being returned, not err.

Making the obvious fix will break a bunch of tests in pipe_test.go, which suggests it might also change the behaviour of real programs. Is it just a matter of calling epipecheck before checking for a short write?

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented May 17, 2017

I think it's just a bug I introduced in the internal/poll work. Will fix.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented May 17, 2017

CL https://golang.org/cl/43558 mentions this issue.

@gopherbot gopherbot closed this in 0fd7de4 May 17, 2017
@golang golang locked and limited conversation to collaborators May 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.