Skip to content

Commit

Permalink
Merge branch 'main' into housekeep
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon authored Feb 24, 2024
2 parents f13000f + eb6f8a8 commit ca36c08
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/kernel/src/kqueue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use crate::{
process::{FileDesc, VThread},
syscalls::{SysErr, SysIn, SysOut, Syscalls},
};
use std::{convert::Infallible, sync::Arc};
use std::{
convert::Infallible,
sync::{Arc, Weak},
};

pub struct KernelQueueManager {}

Expand Down Expand Up @@ -44,13 +47,13 @@ impl KernelQueueManager {

#[derive(Debug)]
pub struct KernelQueue {
filedesc: Arc<FileDesc>,
filedesc: Weak<FileDesc>,
}

impl KernelQueue {
pub fn new(filedesc: &Arc<FileDesc>) -> Arc<Self> {
Arc::new(KernelQueue {
filedesc: filedesc.clone(),
filedesc: Arc::downgrade(filedesc),
})
}
}
Expand All @@ -70,6 +73,6 @@ impl FileBackend for KernelQueue {
_: TruncateLength,
_: Option<&VThread>,
) -> Result<(), Box<dyn Errno>> {
Err(DefaultError::InvalidValue.into())
Err(Box::new(DefaultError::InvalidValue))
}
}

0 comments on commit ca36c08

Please sign in to comment.