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

View File

@ -91,7 +91,6 @@ impl <'a> ArchiveIndexReader<'a> {
rawfd,
header_size as i64) }? as *const u8;
Ok(Self {
store,
filename: full_path,
@ -108,7 +107,7 @@ impl <'a> ArchiveIndexReader<'a> {
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);
}