Skip to content

Commit

Permalink
Implements close for direct dumping
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed May 11, 2024
1 parent 33da54c commit 2135cf0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ impl<K: Kernel> DumpMethod for DirectMethod<K> {
}

fn close(&self, fd: c_int) -> Result<(), NonZeroI32> {
Ok(())
let td = Thread::current();
let errno = unsafe { self.kernel.kern_close(td, fd) };

match NonZeroI32::new(errno) {
Some(v) => Err(v),
None => Ok(()),
}
}
}

0 comments on commit 2135cf0

Please sign in to comment.