scheme-utils: Have FpathWriter handle writing the scheme name

This commit is contained in:
bjorn3
2026-04-19 14:49:11 +02:00
parent 64d23e9e05
commit daf726c30d
24 changed files with 58 additions and 73 deletions
+3 -3
View File
@@ -269,12 +269,12 @@ impl SchemeSync for InputScheme {
}
fn fpath(&mut self, id: usize, buf: &mut [u8], _ctx: &CallerCtx) -> syscall::Result<usize> {
FpathWriter::with(buf, |w| {
let display = self.display.as_ref().ok_or(SysError::new(EINVAL))?;
FpathWriter::with(buf, display, |w| {
let handle = self.handles.get(id)?;
if let Handle::Consumer { vt, .. } = handle {
let display = self.display.as_ref().ok_or(SysError::new(EINVAL))?;
write!(w, "/scheme/{}/{vt}", display).unwrap();
write!(w, "{vt}").unwrap();
Ok(())
} else {
Err(SysError::new(EINVAL))