(pxar: replace deprecated std::mem::uninitialized()

... and use std::mem::MaybeUninit or proxmox::tools::vec::uninitialized() instead.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Christian Ebner
2019-08-22 12:49:06 +02:00
committed by Wolfgang Bumiller
parent 5e58e1bb7d
commit 1af30bc2fe
2 changed files with 7 additions and 5 deletions

View File

@ -1141,9 +1141,10 @@ fn errno_is_unsupported(errno: Errno) -> bool {
}
fn detect_fs_type(fd: RawFd) -> Result<i64, Error> {
let mut fs_stat: libc::statfs = unsafe { std::mem::uninitialized() };
let res = unsafe { libc::fstatfs(fd, &mut fs_stat) };
let mut fs_stat = std::mem::MaybeUninit::uninit();
let res = unsafe { libc::fstatfs(fd, fs_stat.as_mut_ptr()) };
Errno::result(res)?;
let fs_stat = unsafe { fs_stat.assume_init() };
Ok(fs_stat.f_type)
}