mirror of
https://github.com/golang/go
synced 2024-11-22 04:24:39 -07:00
os: fix SameFile to work for directories on windows
R=golang-dev, r CC=golang-dev https://golang.org/cl/5756064
This commit is contained in:
parent
3ea3a7c9a5
commit
7a3c6c950b
@ -199,7 +199,7 @@ func (s *winSys) loadFileId() error {
|
|||||||
}
|
}
|
||||||
s.Lock()
|
s.Lock()
|
||||||
defer s.Unlock()
|
defer s.Unlock()
|
||||||
h, e := syscall.CreateFile(syscall.StringToUTF16Ptr(s.path), syscall.GENERIC_READ, syscall.FILE_SHARE_READ, nil, syscall.OPEN_EXISTING, 0, 0)
|
h, e := syscall.CreateFile(syscall.StringToUTF16Ptr(s.path), 0, 0, nil, syscall.OPEN_EXISTING, syscall.FILE_FLAG_BACKUP_SEMANTICS, 0)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
@ -666,10 +666,6 @@ var absTests = []string{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAbs(t *testing.T) {
|
func TestAbs(t *testing.T) {
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
t.Log("TestAbs disabled on windows")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
oldwd, err := os.Getwd()
|
oldwd, err := os.Getwd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal("Getwd failed: ", err)
|
t.Fatal("Getwd failed: ", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user