fix IsLikelyNotMountPoint func on Windows

pull/8/head
andyzhangx 2018-04-28 04:21:35 +00:00
parent e72d54981a
commit 5671cd81df
1 changed files with 5 additions and 1 deletions

View File

@ -145,7 +145,11 @@ func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) {
}
// If current file is a symlink, then it is a mountpoint.
if stat.Mode()&os.ModeSymlink != 0 {
return false, nil
target, err := os.Readlink(file)
if err != nil {
return true, fmt.Errorf("Readlink error: %v", err)
}
return !mounter.ExistsPath(target), nil
}
return true, nil