build: Fix errors in FreeBSD build
Fixes the following error when cross compiling: ``` --> freebsd/amd64 error: exit status 2 Stderr: # github.com/hashicorp/terraform/config/module config/module/inode.go:18: cannot use st.Ino (type uint32) as type uint64 in return argument ```
This commit is contained in:
parent
46b78286bc
commit
2eb00c9184
|
@ -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