Skip to content

Commit b040f29

Browse files
committed
Correct statvfs type casts for OpenBSD.
On OpenBSD, fsblkcnt_t -- the type of f_blocks -- is a UInt64; therefore, so must `blockSize` be. Ultimately, both sides of the `totalSizeBytes` multiplication should probably be type cast for all platforms, but that's a more significant functional change for another time.
1 parent 50c2e26 commit b040f29

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/FoundationEssentials/FileManager/FileManager+Files.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,9 @@ extension _FileManagerImpl {
733733
#if canImport(Darwin)
734734
let fsNumber = result.f_fsid.val.0
735735
let blockSize = UInt64(result.f_bsize)
736+
#elseif os(OpenBSD)
737+
let fsNumber = result.f_fsid
738+
let blockSize = UInt64(result.f_bsize)
736739
#else
737740
let fsNumber = result.f_fsid
738741
let blockSize = UInt(result.f_frsize)

0 commit comments

Comments
 (0)