Skip to content

Commit e37c45e

Browse files
authored
Merge pull request #65 from Toasterson/posix-support
Change Posix File Locking to x/unix
2 parents 9826264 + f557f30 commit e37c45e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

osfs/os_posix.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
package osfs
44

55
import (
6-
"syscall"
6+
"golang.org/x/sys/unix"
77
)
88

99
func (f *file) Lock() error {
1010
f.m.Lock()
1111
defer f.m.Unlock()
1212

13-
return syscall.Flock(int(f.File.Fd()), syscall.LOCK_EX)
13+
return unix.Flock(int(f.File.Fd()), unix.LOCK_EX)
1414
}
1515

1616
func (f *file) Unlock() error {
1717
f.m.Lock()
1818
defer f.m.Unlock()
1919

20-
return syscall.Flock(int(f.File.Fd()), syscall.LOCK_UN)
20+
return unix.Flock(int(f.File.Fd()), unix.LOCK_UN)
2121
}

0 commit comments

Comments
 (0)