Fix building packer on GOOS=solaris

Update to golang/x/sys/unix is coming in the subsequent commit.
This commit is contained in:
Sean Chittenden 2017-08-11 15:13:55 -07:00
parent 0b4e8474e2
commit cd84b17923
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
2 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,8 @@ package chroot
import (
"os"
"syscall"
"golang.org/x/sys/unix"
)
// See: http://linux.die.net/include/sys/file.h
@ -13,7 +14,7 @@ const LOCK_NB = 4
const LOCK_UN = 8
func lockFile(f *os.File) error {
err := syscall.Flock(int(f.Fd()), LOCK_EX)
err := unix.Flock(int(f.Fd()), LOCK_EX)
if err != nil {
return err
}
@ -22,5 +23,5 @@ func lockFile(f *os.File) error {
}
func unlockFile(f *os.File) error {
return syscall.Flock(int(f.Fd()), LOCK_UN)
return unix.Flock(int(f.Fd()), LOCK_UN)
}

View File

@ -1,4 +1,4 @@
// +build darwin freebsd linux netbsd openbsd
// +build darwin freebsd linux netbsd openbsd solaris
package packer