diff options
Diffstat (limited to 'vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go')
-rw-r--r-- | vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go b/vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go index a7dbb1b46..b30dc1625 100644 --- a/vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go +++ b/vendor/github.com/moby/sys/mountinfo/mountinfo_freebsd.go @@ -51,3 +51,15 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) { } return out, nil } + +func mounted(path string) (bool, error) { + // Fast path: compare st.st_dev fields. + // This should always work for FreeBSD. + mounted, err := mountedByStat(path) + if err == nil { + return mounted, nil + } + + // Fallback to parsing mountinfo + return mountedByMountinfo(path) +} |