mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 00:46:31 +00:00
@ -13,9 +13,10 @@ use crate::{
|
|||||||
ipc::signal::DEFAULT_SIGACTION,
|
ipc::signal::DEFAULT_SIGACTION,
|
||||||
kdebug,
|
kdebug,
|
||||||
libs::{
|
libs::{
|
||||||
|
atomic::atomic_set,
|
||||||
ffi_convert::FFIBind2Rust,
|
ffi_convert::FFIBind2Rust,
|
||||||
refcount::{refcount_inc, RefCount},
|
refcount::{refcount_inc, RefCount},
|
||||||
spinlock::{spin_lock_irqsave, spin_unlock_irqrestore}, atomic::atomic_set,
|
spinlock::{spin_lock_irqsave, spin_unlock_irqrestore},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -87,7 +88,8 @@ pub extern "C" fn process_copy_signal(clone_flags: u64, pcb: *mut process_contro
|
|||||||
pub extern "C" fn process_exit_signal(pcb: *mut process_control_block) {
|
pub extern "C" fn process_exit_signal(pcb: *mut process_control_block) {
|
||||||
// 回收进程的信号结构体
|
// 回收进程的信号结构体
|
||||||
unsafe {
|
unsafe {
|
||||||
drop((*pcb).sighand as *mut sighand_struct);
|
let sighand = Box::from_raw((*pcb).sighand as *mut sighand_struct);
|
||||||
|
drop(sighand);
|
||||||
(*pcb).sighand = 0 as *mut crate::include::bindings::bindings::sighand_struct;
|
(*pcb).sighand = 0 as *mut crate::include::bindings::bindings::sighand_struct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,7 +98,8 @@ pub extern "C" fn process_exit_signal(pcb: *mut process_control_block) {
|
|||||||
pub extern "C" fn process_exit_sighand(pcb: *mut process_control_block) {
|
pub extern "C" fn process_exit_sighand(pcb: *mut process_control_block) {
|
||||||
// todo: 回收进程的sighand结构体
|
// todo: 回收进程的sighand结构体
|
||||||
unsafe {
|
unsafe {
|
||||||
drop((*pcb).signal as *mut signal_struct);
|
let sig = Box::from_raw((*pcb).signal as *mut signal_struct);
|
||||||
|
drop(sig);
|
||||||
(*pcb).signal = 0 as *mut crate::include::bindings::bindings::signal_struct;
|
(*pcb).signal = 0 as *mut crate::include::bindings::bindings::signal_struct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user