Skip to content

Commit ebc5a81

Browse files
committed
Revert "better error reporting on mmap failure (#3)"
This reverts commit e9cae97.
1 parent e9cae97 commit ebc5a81

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ pub enum Error {
66
InvalidFileSize,
77
InvalidHeader,
88
IoError(std::io::Error),
9-
MMapError(std::io::Error),
9+
MMapError(usize),
1010
}

src/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn open_mmap(file: &File, size: usize) -> Result<*mut c_void, Error> {
120120
};
121121

122122
if mmap == libc::MAP_FAILED {
123-
return Err(Error::MMapError(std::io::Error::last_os_error()));
123+
return Err(Error::MMapError(mmap as usize));
124124
}
125125

126126
Ok(mmap)

0 commit comments

Comments
 (0)