Skip to content

Commit

Permalink
fix: restore Syscall6 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 26, 2024
1 parent 11645df commit afee741
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ issues:
exclude-use-default: true
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
- path: flock_winapi.go # Should be fixed in the future
text: 'SA1019: syscall.Syscall6 has been deprecated since Go 1.18: Use SyscallN instead.'
linters:
- staticcheck

output:
show-stats: true
Expand Down
4 changes: 2 additions & 2 deletions flock_winapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx

func lockFileEx(handle syscall.Handle, flags uint32, reserved uint32, numberOfBytesToLockLow uint32, numberOfBytesToLockHigh uint32, offset *syscall.Overlapped) (bool, syscall.Errno) {
r1, _, errNo := syscall.SyscallN(
r1, _, errNo := syscall.Syscall6(
uintptr(procLockFileEx),
6,
uintptr(handle),
Expand All @@ -54,7 +54,7 @@ func lockFileEx(handle syscall.Handle, flags uint32, reserved uint32, numberOfBy
}

func unlockFileEx(handle syscall.Handle, reserved uint32, numberOfBytesToLockLow uint32, numberOfBytesToLockHigh uint32, offset *syscall.Overlapped) (bool, syscall.Errno) {
r1, _, errNo := syscall.SyscallN(
r1, _, errNo := syscall.Syscall6(
uintptr(procUnlockFileEx),
5,
uintptr(handle),
Expand Down

0 comments on commit afee741

Please sign in to comment.