unmount_unix.go 525 B

12345678910111213141516171819202122
  1. // +build !windows
  2. package mount // import "github.com/docker/docker/pkg/mount"
  3. import "golang.org/x/sys/unix"
  4. func unmount(target string, flags int) error {
  5. err := unix.Unmount(target, flags)
  6. if err == nil || err == unix.EINVAL {
  7. // Ignore "not mounted" error here. Note the same error
  8. // can be returned if flags are invalid, so this code
  9. // assumes that the flags value is always correct.
  10. return nil
  11. }
  12. return &mountError{
  13. op: "umount",
  14. target: target,
  15. flags: uintptr(flags),
  16. err: err,
  17. }
  18. }