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:
James Nugent 2016-07-29 18:26:22 -05:00
parent 46b78286bc
commit 2eb00c9184
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")
}