Index: Cargo.toml ================================================================== --- Cargo.toml +++ Cargo.toml @@ -1,8 +1,8 @@ [package] name = "orphanage" -version = "0.2.0" +version = "0.2.1" edition = "2021" license = "0BSD" # https://crates.io/category_slugs categories = [ "network-programming" ] keywords = [ "sqlite", "fs", "path" ] Index: src/fs.rs ================================================================== --- src/fs.rs +++ src/fs.rs @@ -154,11 +154,21 @@ let mut statfs = unsafe { std::mem::zeroed() }; let result = unsafe { libc::statfs(cstr_path.as_ptr().cast::(), &mut statfs) }; if result == 0 { - Ok(statfs.f_bavail as u64 * u64::from(statfs.f_bsize)) + #[cfg(target_os = "macos")] + let free = statfs.f_bavail as u64 * u64::from(statfs.f_bsize); + + #[cfg(target_os = "linux")] + #[allow(clippy::cast_sign_loss)] + let free = statfs.f_bavail * statfs.f_bsize as u64; + + #[cfg(not(any(target_os = "macos", target_os = "linux")))] + let free = statfs.f_bavail as u64 * statfs.f_bsize; + + Ok(free) } else { Err(Error::IO("statfs() failed".into())) } } Index: www/changelog.md ================================================================== --- www/changelog.md +++ www/changelog.md @@ -2,18 +2,28 @@ ⚠️ indicates a breaking change. ## [Unreleased] -[Details](/vdiff?from=orphanage-0.2.0&to=trunk) +[Details](/vdiff?from=orphanage-0.2.1&to=trunk) ### Added ### Changed ### Removed +--- + +## [0.2.1] - 2025-04-03 + +[Details](/vdiff?from=orphanage-0.2.0&to=orphanage-0.2.1) + +### Changed + +- Fix a platform-specific cast. + --- ## [0.2.0] - 2025-04-03 [Details](/vdiff?from=orphanage-0.1.4&to=orphanage-0.2.0)