mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 18:26:48 +00:00
fix: 解决进程退出时没有主动释放fdtable的问题 (#1069)
会导致http server被kill时,pcb没有drop Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
parent
ffa8e88c60
commit
4f8f269baf
@ -426,6 +426,7 @@ impl ProcessManager {
|
||||
}
|
||||
drop(thread);
|
||||
unsafe { pcb.basic_mut().set_user_vm(None) };
|
||||
pcb.exit_files();
|
||||
|
||||
// TODO 由于未实现进程组,tty记录的前台进程组等于当前进程,故退出前要置空
|
||||
// 后续相关逻辑需要在SYS_EXIT_GROUP系统调用中实现
|
||||
@ -1055,6 +1056,11 @@ impl ProcessControlBlock {
|
||||
pub fn set_nsproxy(&self, nsprsy: NsProxy) {
|
||||
*self.nsproxy.write() = nsprsy;
|
||||
}
|
||||
|
||||
/// Exit fd table when process exit
|
||||
fn exit_files(&self) {
|
||||
self.basic.write_irqsave().set_fd_table(None);
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ProcessControlBlock {
|
||||
|
Loading…
x
Reference in New Issue
Block a user