From 88815ccaeaa1237994f0de545c4df584e853afe4 Mon Sep 17 00:00:00 2001 From: pjht Date: Sat, 16 Nov 2024 11:54:09 -0600 Subject: [PATCH] Add mode to open operation --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index a708a96..5478991 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use std::{ fs::File, io::{Read, Seek, SeekFrom}, - os::mikros::{ipc, syscalls, Errno}, + os::mikros::{ipc, syscalls, Errno, FileCreationMode, FileOpenMode, FileWriteMode}, path::Path, sync::{atomic::{AtomicU64, Ordering}, Arc}, }; @@ -55,7 +55,7 @@ struct Serv { } impl dev_driver_rpc::Server for Serv { - fn open(&self, path: &std::path::Path) -> Result { + fn open(&self, path: &std::path::Path, _mode: FileOpenMode) -> Result { let part = *(self.parts.get(path.to_str().unwrap()).ok_or(Errno::EBADF)?); Ok(self.open_files.insert(OpenFile { drive_file: part.0, @@ -281,7 +281,7 @@ fn main() { .unwrap(); let drive_file = vfs_client - .open(Path::new(&format!("/dev/{}", dev_name))) + .open(Path::new(&format!("/dev/{}", dev_name)), FileOpenMode::ReadWrite(FileWriteMode::Start, FileCreationMode::NoCreate)) .unwrap(); for (i, part) in gpt_entries.iter().enumerate() { @@ -314,7 +314,7 @@ fn main() { println!("Disk has MBR"); let drive_file = vfs_client - .open(Path::new(&format!("/dev/{}", dev_name))) + .open(Path::new(&format!("/dev/{}", dev_name)), FileOpenMode::ReadWrite(FileWriteMode::Start, FileCreationMode::NoCreate)) .unwrap(); for (i, part) in mbr_entries.iter().enumerate() {