Fix sigaction Undefind Behavior
Rust does not allow a `fn`-pointer to be null. This fixes that, while luckily doing it in a way that leaves system calls backwards-compatible :)
This commit is contained in:
@@ -15,7 +15,7 @@ pub extern "C" fn signal_handler(sig: usize) {
|
||||
actions[sig]
|
||||
};
|
||||
|
||||
let handler = action.sa_handler as usize;
|
||||
let handler = action.sa_handler.map(|ptr| ptr as usize).unwrap_or(0);
|
||||
if handler == SIG_DFL {
|
||||
match sig {
|
||||
SIGCHLD => {
|
||||
|
||||
2
syscall
2
syscall
Submodule syscall updated: eddcb80eb7...f3bb1f7b68
Reference in New Issue
Block a user