mirror of https://github.com/golang/go.git
time: return ENOENT instead of ERROR_PATH_NOT_FOUND in windows
When using windows some users got a weird error (File not found) when the timezone database is not found. It happens because some methods in the time package don't treat ERROR_PATH_NOT_FOUND and ENOTDIR. To solve it was added a conversion to ENOTENT error. Fixes #50248
This commit is contained in:
parent
e76396248a
commit
fe7fff90cb
|
|
@ -16,7 +16,7 @@ func interrupt() {
|
|||
func open(name string) (uintptr, error) {
|
||||
fd, err := syscall.Open(name, syscall.O_RDONLY, 0)
|
||||
if err != nil {
|
||||
//This condition solves issue 50248 (https://github.com/golang/go/issues/50248)
|
||||
// This condition solves issue https://go.dev/issue/50248
|
||||
if err == syscall.ERROR_PATH_NOT_FOUND {
|
||||
err = syscall.ENOENT
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue