Refactor error handling in fd_advise

This commit is contained in:
Marcin Mielniczuk
2019-09-13 14:21:13 +02:00
committed by Jakub Konka
parent 86e3d3e307
commit 8d7e80f440

View File

@@ -63,8 +63,7 @@ pub(crate) fn fd_advise(
_ => return Err(Error::EINVAL), _ => return Err(Error::EINVAL),
}; };
posix_fadvise(file.as_raw_fd(), offset, len, host_advice) posix_fadvise(file.as_raw_fd(), offset, len, host_advice)?;
.map_err(|err| errno_from_nix(err.as_errno().unwrap()))?;
} }
Ok(()) Ok(())