From 8d7e80f44086d0c9d0840bd1b33f97bf0c34b53f Mon Sep 17 00:00:00 2001 From: Marcin Mielniczuk Date: Fri, 13 Sep 2019 14:21:13 +0200 Subject: [PATCH] Refactor error handling in fd_advise --- src/sys/unix/hostcalls_impl/fs.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sys/unix/hostcalls_impl/fs.rs b/src/sys/unix/hostcalls_impl/fs.rs index becf117624..5de682fa00 100644 --- a/src/sys/unix/hostcalls_impl/fs.rs +++ b/src/sys/unix/hostcalls_impl/fs.rs @@ -63,8 +63,7 @@ pub(crate) fn fd_advise( _ => return Err(Error::EINVAL), }; - posix_fadvise(file.as_raw_fd(), offset, len, host_advice) - .map_err(|err| errno_from_nix(err.as_errno().unwrap()))?; + posix_fadvise(file.as_raw_fd(), offset, len, host_advice)?; } Ok(())