UnmountAll is a no-op for missing mount points

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-04-04 12:59:52 -07:00
parent 8538e7a2ac
commit c9e5c33a18

View File

@ -177,6 +177,9 @@ func UnmountAll(mount string, flags int) error {
// This isn't an error, per the EINVAL handling in the Linux version
return nil
}
if _, err := os.Stat(mount); os.IsNotExist(err) {
return nil
}
return Unmount(mount, flags)
}