Skip to content

Commit

Permalink
Merge pull request #1699 from shirou/feat/win_disk_ignore_remote_driv…
Browse files Browse the repository at this point in the history
…e_on_error

[disk][windows]: ignore network drive when not ready
  • Loading branch information
shirou authored Aug 26, 2024
2 parents 829f2fa + 72d3ba4 commit 7404c1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion disk/disk_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro
uintptr(unsafe.Pointer(&lpFileSystemNameBuffer[0])),
uintptr(len(lpFileSystemNameBuffer)))
if driveret == 0 {
if typeret == 5 || typeret == 2 {
if typeret == 2 || typeret == 4 || typeret == 5 {
continue // device is not ready will happen if there is no disk in the drive
}
warnings.Add(err)
Expand Down

0 comments on commit 7404c1f

Please sign in to comment.