backup/archive_index.rs: pass correct size to unmap

This commit is contained in:
Dietmar Maurer 2019-01-04 09:28:41 +01:00
parent 48d0d35688
commit b663789bdb
1 changed files with 1 additions and 2 deletions

View File

@ -91,7 +91,6 @@ impl <'a> ArchiveIndexReader<'a> {
rawfd, rawfd,
header_size as i64) }? as *const u8; header_size as i64) }? as *const u8;
Ok(Self { Ok(Self {
store, store,
filename: full_path, filename: full_path,
@ -108,7 +107,7 @@ impl <'a> ArchiveIndexReader<'a> {
if self.index == std::ptr::null_mut() { return Ok(()); } if self.index == std::ptr::null_mut() { return Ok(()); }
if let Err(err) = unsafe { nix::sys::mman::munmap(self.index as *mut std::ffi::c_void, self.size) } { if let Err(err) = unsafe { nix::sys::mman::munmap(self.index as *mut std::ffi::c_void, self.index_entries*40) } {
bail!("unmap file {:?} failed - {}", self.filename, err); bail!("unmap file {:?} failed - {}", self.filename, err);
} }