Merge pull request #8035 from ktock/fixunmount
Make argument validation of `mount.UnmountRecursive` compatible to `mount.UnmountAll`
This commit is contained in:
commit
60363db5bc
@ -27,6 +27,9 @@ import (
|
|||||||
// UnmountRecursive unmounts the target and all mounts underneath, starting
|
// UnmountRecursive unmounts the target and all mounts underneath, starting
|
||||||
// with the deepest mount first.
|
// with the deepest mount first.
|
||||||
func UnmountRecursive(target string, flags int) error {
|
func UnmountRecursive(target string, flags int) error {
|
||||||
|
if target == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
mounts, err := mountinfo.GetMounts(mountinfo.PrefixFilter(target))
|
mounts, err := mountinfo.GetMounts(mountinfo.PrefixFilter(target))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user