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

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
Copy link
Contributor

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

@gopherbot
Copy link

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

@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
Development

No branches or pull requests

3 participants