2018-10-25 10:44:28 -07:00
|
|
|
// +build !windows
|
|
|
|
|
|
|
|
package mount // import "github.com/docker/docker/pkg/mount"
|
|
|
|
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
|
|
|
|
func unmount(target string, flags int) error {
|
|
|
|
err := unix.Unmount(target, flags)
|
2018-10-22 18:30:34 -07:00
|
|
|
if err == nil || err == unix.EINVAL {
|
2018-10-25 10:44:28 -07:00
|
|
|
// 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.
|
2018-10-22 18:30:34 -07:00
|
|
|
return nil
|
2018-10-25 10:44:28 -07:00
|
|
|
}
|
|
|
|
|
2018-10-22 18:30:34 -07:00
|
|
|
return &mountError{
|
|
|
|
op: "umount",
|
|
|
|
target: target,
|
|
|
|
flags: uintptr(flags),
|
|
|
|
err: err,
|
|
|
|
}
|
2018-10-25 10:44:28 -07:00
|
|
|
}
|