clippy fix

This commit is contained in:
Anton-4 2022-11-08 13:42:07 +01:00
parent bb3eed6ae7
commit 48bf8681bc
No known key found for this signature in database
GPG key ID: A13F4A6E21141925

View file

@ -63,11 +63,11 @@ impl<'a> ExpectMemory<'a> {
if libc::fstat(shared_fd, &mut stat) == -1 {
internal_error!("failed to stat shared file, does it exist?");
}
if stat.st_size < Self::SHM_SIZE as _ {
if libc::ftruncate(shared_fd, Self::SHM_SIZE as _) == -1 {
if stat.st_size < Self::SHM_SIZE as _
&& libc::ftruncate(shared_fd, Self::SHM_SIZE as _) == -1
{
internal_error!("failed to truncate shared file, are the permissions wrong?");
}
}
let ptr = libc::mmap(
std::ptr::null_mut(),