Add mode to open operation

This commit is contained in:
pjht 2024-11-16 11:54:26 -06:00
parent 527dfefd40
commit a21911cc30
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -24,7 +24,7 @@ use std::{
borrow::Cow, borrow::Cow,
collections::{HashMap, VecDeque}, collections::{HashMap, VecDeque},
fmt::{self, Write}, fmt::{self, Write},
os::mikros::{address_space::ACTIVE_SPACE, ipc, syscalls, Errno}, os::mikros::{address_space::ACTIVE_SPACE, ipc, syscalls, Errno, FileOpenMode},
}; };
use fontdue::{ use fontdue::{
@ -336,7 +336,7 @@ impl fmt::Write for FramebufferWriter {
struct DevServ; struct DevServ;
impl dev_driver_rpc::Server for DevServ { impl dev_driver_rpc::Server for DevServ {
fn open(&self, _path: &std::path::Path) -> Result<u64, Errno> { fn open(&self, _path: &std::path::Path, _mode: FileOpenMode) -> Result<u64, Errno> {
Ok(0) Ok(0)
} }
} }
@ -361,7 +361,7 @@ impl file_rpc::Server for FileServ {
let string = String::from_utf8_lossy(data); let string = String::from_utf8_lossy(data);
let mut fbwriter = self.fbwriter.lock(); let mut fbwriter = self.fbwriter.lock();
let mut fbuffer = self.fbuffer.lock(); let mut fbuffer = self.fbuffer.lock();
let _ = fbwriter.write_str(&*string); // never errors let _ = fbwriter.write_str(&string); // never errors
fbwriter.update_screen(&mut fbuffer); fbwriter.update_screen(&mut fbuffer);
Ok(()) Ok(())
} }