You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
478 B
Go
23 lines
478 B
Go
6 years ago
|
// +build !windows
|
||
|
|
||
4 years ago
|
package mount
|
||
6 years ago
|
|
||
|
import "golang.org/x/sys/unix"
|
||
|
|
||
|
func unmount(target string, flags int) error {
|
||
|
err := unix.Unmount(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,
|
||
|
}
|
||
|
}
|