Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenBSD (amd64 and arm64) - sys/statfs.rs - fix #1186

Closed
LouisJasbetz opened this issue Feb 12, 2020 · 3 comments
Closed

OpenBSD (amd64 and arm64) - sys/statfs.rs - fix #1186

LouisJasbetz opened this issue Feb 12, 2020 · 3 comments

Comments

@LouisJasbetz
Copy link

LouisJasbetz commented Feb 12, 2020

Hi,

File:
sys/statfs.rs

target_os = "openbsd"
-----------------------------------
pub fn optimal_transfer_size(&self) -> i32 {
    |         self.0.f_iosize
    |         ^^^^^^^^^^^^^^^ expected i32, found u32
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
-----------------------------------
target_os = "openbsd"
-----------------------------------
pub fn files_free(&self) -> i64 {
    |         self.0.f_ffree
    |         ^^^^^^^^^^^^^^ expected i64, found u64
help: you can convert an `u64` to `i64` and panic if the converted value wouldn't fit
-----------------------------------

please fix to:

self.0.f_iosize as i32
self.0.f_ffree as i64

Regards,
Louis Jasbetz

@asomers
Copy link
Member

asomers commented Mar 8, 2020

Can you please clarify which version of OpenBSD you're using? And if you could submit a PR too, that would be great.

@Artoria2e5
Copy link

Commit 7a1e861 should have fixed this issue since v0.17.0. Update your crate.

According to the online blame at https://github.com/openbsd/src/blame/f0801dd35b987df069e806e4afc6f87aa5da4038/sys/sys/mount.h, f_iosize has been u32 and f_free has been u64 for 12 years.

@asomers
Copy link
Member

asomers commented May 2, 2020

Closing as duplicate of #1125 .

@asomers asomers closed this as completed May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants