diff --git a/crates/repl_expect/src/run.rs b/crates/repl_expect/src/run.rs index d6b7921e1a..2ec241aca6 100644 --- a/crates/repl_expect/src/run.rs +++ b/crates/repl_expect/src/run.rs @@ -63,10 +63,10 @@ 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 { - internal_error!("failed to truncate shared file, are the permissions wrong?"); - } + 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(