From 027d3c375dfdc993d48cbb73f9b524797cd6c111 Mon Sep 17 00:00:00 2001 From: pjht Date: Sun, 17 Nov 2024 21:51:03 -0600 Subject: [PATCH] Dup now ereturns original FD --- src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 39e7ed6..f51a21b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use std::{ borrow::Cow, fs::File, os::mikros::{ipc, syscalls, Errno, FileOpenMode}, - sync::Arc, usize, + sync::Arc, }; use ext2::Ext2; @@ -90,10 +90,7 @@ impl file_rpc::Server for Serv { } fn dup(&self, fd: u64) -> Result { - let mut files = self.files.write(); - let file = files[fd as usize].clone(); - files.push(file); - Ok((files.len() - 1) as u64) + Ok(fd) } fn seek(&self, fd: u64, pos: file_rpc::SeekFrom) -> Result {