Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
brianryner8 committed Dec 18, 2022
1 parent 34da06e commit c2fa2cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion disk/disk_darwin.go
Expand Up @@ -24,7 +24,10 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro
if err != nil {
return ret, err
}
fs = fs[:count] // Actual count may be less than from the first call.
// On 10.14, and possibly other OS versions, the actual count may
// be less than from the first call. Truncate to the returned count
// to prevent accessing uninitialized entries.
fs = fs[:count]
for _, stat := range fs {
opts := []string{"rw"}
if stat.Flags&unix.MNT_RDONLY != 0 {
Expand Down

0 comments on commit c2fa2cb

Please sign in to comment.