Merge pull request #7880 from hashicorp/b-fix-freebsd
build: Fix errors in FreeBSD build
This commit is contained in:
commit
b2d5b66508
|
@ -1,4 +1,4 @@
|
|||
// +build !windows
|
||||
// +build !windows !freebsd
|
||||
|
||||
package module
|
||||
|
||||
|
|
|
@ -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")
|
||||
}
|
Loading…
Reference in New Issue