From b79e7cabbc74bd811b2243b26718cbba7b41626d Mon Sep 17 00:00:00 2001 From: Michelle Au Date: Mon, 9 Apr 2018 17:31:50 -0700 Subject: [PATCH] Remove isNotDir error check --- pkg/util/mount/mount.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/util/mount/mount.go b/pkg/util/mount/mount.go index f30db7692e..7c808685ea 100644 --- a/pkg/util/mount/mount.go +++ b/pkg/util/mount/mount.go @@ -22,7 +22,6 @@ import ( "os" "path/filepath" "strings" - "syscall" ) type FileType string @@ -232,13 +231,6 @@ func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, e return device, refCount, nil } -func isNotDirErr(err error) bool { - if e, ok := err.(*os.PathError); ok && e.Err == syscall.ENOTDIR { - return true - } - return false -} - // IsNotMountPoint determines if a directory is a mountpoint. // It should return ErrNotExist when the directory does not exist. // This method uses the List() of all mountpoints @@ -254,7 +246,7 @@ func IsNotMountPoint(mounter Interface, file string) (bool, error) { notMnt = true notMntErr = nil } - if notMntErr != nil && isNotDirErr(notMntErr) { + if notMntErr != nil { return notMnt, notMntErr } // identified as mountpoint, so return this fact