]> Cypherpunks repositories - gostls13.git/commitdiff
os: fix SameFile to work for directories on windows
authorAlex Brainman <alex.brainman@gmail.com>
Wed, 7 Mar 2012 00:01:23 +0000 (11:01 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Wed, 7 Mar 2012 00:01:23 +0000 (11:01 +1100)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5756064

src/pkg/os/stat_windows.go
src/pkg/path/filepath/path_test.go

index 19e215e935fbd4d24e733a3cb15fb48545a7ecc1..6841748345061f7ed6b0715cfc4781d2188de2f7 100644 (file)
@@ -199,7 +199,7 @@ func (s *winSys) loadFileId() error {
        }
        s.Lock()
        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 {
                return e
        }
index 6bc631596ec264d0710b178341549ed4934c1aa7..ad053177f5376f40bbf75e41cc6c09b6b4648101 100644 (file)
@@ -666,10 +666,6 @@ var absTests = []string{
 }
 
 func TestAbs(t *testing.T) {
-       if runtime.GOOS == "windows" {
-               t.Log("TestAbs disabled on windows")
-               return
-       }
        oldwd, err := os.Getwd()
        if err != nil {
                t.Fatal("Getwd failed: ", err)