Skip to content
Snippets Groups Projects
Verified Commit 8695ecd8 authored by jD91mZM2's avatar jD91mZM2
Browse files

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 :)
parent be867ae5
No related branches found
No related tags found
1 merge request!106Drive ptrace into a wall, prepare for overhaul
......@@ -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 => {
......
Subproject commit eddcb80eb7c2d43dedf0ba2ee514b54b0b8fafc7
Subproject commit f3bb1f7b68bc8e5544857781de9eb8729b2843f4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment