Dup now ereturns original FD
This commit is contained in:
parent
b6af654b1a
commit
027d3c375d
@ -4,7 +4,7 @@ use std::{
|
|||||||
borrow::Cow,
|
borrow::Cow,
|
||||||
fs::File,
|
fs::File,
|
||||||
os::mikros::{ipc, syscalls, Errno, FileOpenMode},
|
os::mikros::{ipc, syscalls, Errno, FileOpenMode},
|
||||||
sync::Arc, usize,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
use ext2::Ext2;
|
use ext2::Ext2;
|
||||||
@ -90,10 +90,7 @@ impl file_rpc::Server for Serv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn dup(&self, fd: u64) -> Result<u64, Errno> {
|
fn dup(&self, fd: u64) -> Result<u64, Errno> {
|
||||||
let mut files = self.files.write();
|
Ok(fd)
|
||||||
let file = files[fd as usize].clone();
|
|
||||||
files.push(file);
|
|
||||||
Ok((files.len() - 1) as u64)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn seek(&self, fd: u64, pos: file_rpc::SeekFrom) -> Result<u64, Errno> {
|
fn seek(&self, fd: u64, pos: file_rpc::SeekFrom) -> Result<u64, Errno> {
|
||||||
|
Loading…
Reference in New Issue
Block a user