0

Upgrade versions of vendored libs

This commit is contained in:
eleksir
2023-05-18 23:55:10 +03:00
parent 4869c146fe
commit 7958db9c0d
555 changed files with 36170 additions and 15565 deletions

View File

@@ -9,29 +9,30 @@ package vfs
import (
"io"
"syscall"
"golang.org/x/sys/windows"
)
// lockCloser hides all of an syscall.Handle's methods, except for Close.
// lockCloser hides all of an windows.Handle's methods, except for Close.
type lockCloser struct {
fd syscall.Handle
fd windows.Handle
}
func (l lockCloser) Close() error {
return syscall.Close(l.fd)
return windows.Close(l.fd)
}
// Lock locks the given file. On Windows, Locking will fail if the file is
// already open by the current process.
func (defaultFS) Lock(name string) (io.Closer, error) {
p, err := syscall.UTF16PtrFromString(name)
p, err := windows.UTF16PtrFromString(name)
if err != nil {
return nil, err
}
fd, err := syscall.CreateFile(p,
syscall.GENERIC_READ|syscall.GENERIC_WRITE,
0, nil, syscall.CREATE_ALWAYS,
syscall.FILE_ATTRIBUTE_NORMAL,
fd, err := windows.CreateFile(p,
windows.GENERIC_READ|windows.GENERIC_WRITE,
0, nil, windows.CREATE_ALWAYS,
windows.FILE_ATTRIBUTE_NORMAL,
0,
)
if err != nil {