aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/moby/sys/mount/unmount_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/moby/sys/mount/unmount_unix.go')
-rw-r--r--vendor/github.com/moby/sys/mount/unmount_unix.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/github.com/moby/sys/mount/unmount_unix.go b/vendor/github.com/moby/sys/mount/unmount_unix.go
new file mode 100644
index 000000000..924d059a7
--- /dev/null
+++ b/vendor/github.com/moby/sys/mount/unmount_unix.go
@@ -0,0 +1,26 @@
+// +build !windows
+
+package mount
+
+import "golang.org/x/sys/unix"
+
+func unmountBare(target string, flags int) error {
+ return unix.Unmount(target, flags)
+}
+
+func unmount(target string, flags int) error {
+ err := unmountBare(target, flags)
+ if err == nil || err == unix.EINVAL {
+ // Ignore "not mounted" error here. Note the same error
+ // can be returned if flags are invalid, so this code
+ // assumes that the flags value is always correct.
+ return nil
+ }
+
+ return &mountError{
+ op: "umount",
+ target: target,
+ flags: uintptr(flags),
+ err: err,
+ }
+}