Make mount.UnmountRecursive compatible to mount.UnmountAll

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
Kohei Tokunaga 2023-01-31 22:07:44 +09:00
parent e307f87971
commit eeab052425

View File

@ -27,6 +27,9 @@ import (
// UnmountRecursive unmounts the target and all mounts underneath, starting
// with the deepest mount first.
func UnmountRecursive(target string, flags int) error {
if target == "" {
return nil
}
mounts, err := mountinfo.GetMounts(mountinfo.PrefixFilter(target))
if err != nil {
return err