Skip to content

Commit

Permalink
Merge pull request #7880 from hashicorp/b-fix-freebsd
Browse files Browse the repository at this point in the history
build: Fix errors in FreeBSD build
  • Loading branch information
jen20 authored Jul 29, 2016
2 parents 2747d96 + 2eb00c9 commit b2d5b66
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/module/inode.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !windows
// +build !windows !freebsd

package module

Expand Down
19 changes: 19 additions & 0 deletions config/module/inode_freebsd.go
Original file line number Diff line number Diff line change
@@ -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")
}

0 comments on commit b2d5b66

Please # to comment.