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.Sync should return *PathError on Plan 9 #39800

Closed
fhs opened this issue Jun 24, 2020 · 2 comments
Closed

os: File.Sync should return *PathError on Plan 9 #39800

fhs opened this issue Jun 24, 2020 · 2 comments

Comments

@fhs
Copy link
Contributor

@fhs fhs commented Jun 24, 2020

File.Sync currently returns *SyscallError on Plan 9. It should return *PathError so that the error type matches other systems.

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

$ go version
go version devel +master Sat Jun 20 01:48:54 EDT 2020 plan9/amd64

What did you do?

Run:

package main

import (
	"fmt"
	"os"
)

func main() {
	err := os.Stderr.Sync()
	if err != nil {
		fmt.Printf("%T: %v\n", err, err)
	}
}

What did you expect to see?

Filename in the error, for example on Linux:

*os.PathError: sync /dev/stderr: invalid argument

What did you see instead?

*os.SyscallError: fsync: permission denied

@gopherbot add labels OS-Plan9, NeedsFix

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 25, 2020

CC @0intro

@ianlancetaylor ianlancetaylor added this to the Backlog milestone Jun 25, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 25, 2020

Change https://golang.org/cl/239857 mentions this issue: os: return *PathError error in File.Sync on Plan 9

@gopherbot gopherbot closed this in 334752d Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.