Change the error when trying to write to a file to EROFS

This commit is contained in:
pjht 2024-11-20 12:30:24 -06:00
parent 027d3c375d
commit 201c982b26
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A

View File

@ -37,7 +37,7 @@ impl fs_rpc::Server for Serv {
fn open(&self, path: &std::path::Path, mode: FileOpenMode, mount_id: u64) -> Result<(Option<u64>, u64), Errno> { fn open(&self, path: &std::path::Path, mode: FileOpenMode, mount_id: u64) -> Result<(Option<u64>, u64), Errno> {
if !mode.readable() || mode.writable() { if !mode.readable() || mode.writable() {
// WRiting isn't supported yet, so the only sensible mode is readonly. // WRiting isn't supported yet, so the only sensible mode is readonly.
return Err(Errno::EACCES); return Err(Errno::EROFS);
} }
let mounts = self.mounts.read(); let mounts = self.mounts.read();
let mount = &mounts[mount_id as usize]; let mount = &mounts[mount_id as usize];