You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation of statfs requires mutable reference of result variable, but I can't pass it to statfs without initialization. For example this code
error[E0381]:use of possibly uninitialized variable: `statf`
sys::statfs::statfs(Path::new(&String::from("/")),&mut statf).unwrap();
^^^^^ use of possibly uninitialized `statf`
Yes, that seems like the correct change. Additionally we should use a newtype wrapper around libc::statfs so we don't export libc types directly (this prevents libc breaking changes to become major-release breaking changes in nix).
The only open question here is whether reusing a statfs struct is ever necessary in practice. If so, we'd probably want two versions of each function, one returning the struct the other filling it in-place. I'd bet this functionality isn't necessary, but a look at production code would be useful here.
@alesharik Would you be willing to file a PR to fix this? It's unlikely to get fixed anytime soon if you aren't.
Current implementation of
statfs
requires mutable reference of result variable, but I can't pass it tostatfs
without initialization. For example this codegives me this error:
So I need to somehow initialize the variable:
Maybe it will be better to return result with
libc::statfs
struct instead of empty result?The text was updated successfully, but these errors were encountered: