Fix the SIGKILL fd leak bug.
This commit is contained in:
+1
-1
@@ -328,7 +328,7 @@ pub fn syscall(
|
||||
// back to any given context, where the signal set/queue is nonempty, syscalls need to
|
||||
// complete *before* any signal is delivered. Otherwise the return value would probably be
|
||||
// overwritten.
|
||||
crate::context::signal::signal_handler(true);
|
||||
crate::context::signal::signal_handler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user