Merge pull request #366 from tmm1/patch-2

Ignore GetVolumeInformation errors on DRIVE_REMOVABLE volumes
pull/367/head
shirou 8 years ago committed by GitHub
commit 37c114fe6c

@ -103,7 +103,7 @@ func Partitions(all bool) ([]PartitionStat, error) {
uintptr(unsafe.Pointer(&lpFileSystemNameBuffer[0])),
uintptr(len(lpFileSystemNameBuffer)))
if driveret == 0 {
if typeret == 5 {
if typeret == 5 || typeret == 2 {
continue //device is not ready will happen if there is no disk in the drive
}
return ret, err

Loading…
Cancel
Save