Ignore ERROR_NOT_FOUND error when removing mount

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-02-28 14:31:26 -08:00
parent db32798592
commit 7a36efd75e

View File

@ -144,7 +144,7 @@ func Unmount(mount string, flags int) error {
}
if err := bindfilter.RemoveFileBinding(mount); err != nil {
if errno, ok := errors.Unwrap(err).(syscall.Errno); ok && errno == windows.ERROR_INVALID_PARAMETER {
if errno, ok := errors.Unwrap(err).(syscall.Errno); ok && errno == windows.ERROR_INVALID_PARAMETER || errno == windows.ERROR_NOT_FOUND {
// not a mount point
return nil
}