| Total Lines | 14 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | // +build !windows |
||
| 3 | package providers |
||
| 4 | |||
| 5 | import ( |
||
| 6 | "syscall" |
||
| 7 | ) |
||
| 8 | |||
| 9 | // lockFile acquires an exclusive lock on the file descriptor |
||
| 10 | func lockFile(fd int) error { |
||
| 11 | return syscall.Flock(fd, syscall.LOCK_EX) |
||
| 12 | } |
||
| 13 | |||
| 14 | // unlockFile releases the lock on the file descriptor |
||
| 15 | func unlockFile(fd int) error { |
||
| 16 | return syscall.Flock(fd, syscall.LOCK_UN) |
||
| 17 | } |
||
| 18 |