mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 02:43:24 +00:00
Drop files at the correct time
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
7e1abc1fbb
commit
8600278a5f
@ -7,8 +7,8 @@ pub fn sys_close(fd: FileDesc, ctx: &Context) -> Result<SyscallReturn> {
|
||||
debug!("fd = {}", fd);
|
||||
|
||||
let file = {
|
||||
let file_table = ctx.thread_local.file_table().borrow();
|
||||
let mut file_table_locked = file_table.write();
|
||||
let file_table = ctx.thread_local.borrow_file_table();
|
||||
let mut file_table_locked = file_table.unwrap().write();
|
||||
let _ = file_table_locked.get_file(fd)?;
|
||||
file_table_locked.close_file(fd).unwrap()
|
||||
};
|
||||
|
Reference in New Issue
Block a user