Browse Source

windows: use FILE_FLAG_BACKUP_SEMANTICS in Utimes/UtimesNano

This is a copy of https://golang.org/cl/154020043 in the syscall package.

Fixes golang/go#10804

Change-Id: I6f6177e30c105c8065fdc8cc351e899090e160a9
Reviewed-on: https://go-review.googlesource.com/10076
Reviewed-by: Minux Ma <minux@golang.org>
Alex Brainman 10 years ago
parent
commit
1caf55eba1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      windows/syscall_windows.go

+ 2 - 2
windows/syscall_windows.go

@@ -430,7 +430,7 @@ func Utimes(path string, tv []Timeval) (err error) {
 	}
 	h, e := CreateFile(pathp,
 		FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil,
-		OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
+		OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)
 	if e != nil {
 		return e
 	}
@@ -450,7 +450,7 @@ func UtimesNano(path string, ts []Timespec) (err error) {
 	}
 	h, e := CreateFile(pathp,
 		FILE_WRITE_ATTRIBUTES, FILE_SHARE_WRITE, nil,
-		OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
+		OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)
 	if e != nil {
 		return e
 	}