Fix the SIGKILL fd leak bug.

This commit is contained in:
4lDO2
2024-03-07 20:01:44 +01:00
parent 8e19da338b
commit 4a3dc2dadd
9 changed files with 58 additions and 29 deletions
+1 -2
View File
@@ -43,8 +43,7 @@ pub fn exit(status: usize) -> ! {
let mut context = context_lock.write();
close_files = Arc::try_unwrap(mem::take(&mut context.files))
.map_or_else(|_| Vec::new(), RwLock::into_inner);
addrspace_opt =
mem::take(&mut context.addr_space).and_then(|a| Arc::try_unwrap(a).ok());
addrspace_opt = context.set_addr_space(None).and_then(|a| Arc::try_unwrap(a).ok());
drop(context.syscall_head.take());
drop(context.syscall_tail.take());
context.id