Commit ec072bb7 authored by Jeremy Soller's avatar Jeremy Soller

Return correct error for fevent on files

parent 015d352e
Pipeline #4020 passed with stages
in 2 minutes and 29 seconds
......@@ -494,6 +494,16 @@ impl<D: Disk> Scheme for FileScheme<D> {
}
}
fn fevent(&self, id: usize, flags: usize) -> Result<usize> {
let files = self.files.borrow_mut();
if let Some(file) = files.get(&id) {
// EPERM is returned for files that are always readable or writable
Err(Error::new(EPERM))
} else {
Err(Error::new(EBADF))
}
}
fn fpath(&self, id: usize, buf: &mut [u8]) -> Result<usize> {
// println!("Fpath {}, {:X} {}", id, buf.as_ptr() as usize, buf.len());
let files = self.files.borrow_mut();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment