From 1caf55eba1a755134294f972e0e17e5be7f67f8a Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Thu, 14 May 2015 14:46:55 +1000 Subject: [PATCH] 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 --- windows/syscall_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/syscall_windows.go b/windows/syscall_windows.go index 2784f173..c7984027 100644 --- a/windows/syscall_windows.go +++ b/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 }