Merge pull request #7880 from hashicorp/b-fix-freebsd

build: Fix errors in FreeBSD build
This commit is contained in:
James Nugent 2016-07-29 18:30:55 -05:00 committed by GitHub
commit b2d5b66508
2 changed files with 20 additions and 1 deletions

View File

@ -1,4 +1,4 @@
// +build !windows
// +build !windows !freebsd
package module

View File

@ -0,0 +1,19 @@
package module
import (
"fmt"
"os"
"syscall"
)
// lookup the inode of a file on posix systems
func inode(path string) (uint64, error) {
stat, err := os.Stat(path)
if err != nil {
return 0, err
}
if st, ok := stat.Sys().(*syscall.Stat_t); ok {
return uint64(st.Ino), nil
}
return 0, fmt.Errorf("could not determine file inode")
}