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:
jD91mZM2
2019-07-20 22:13:54 +02:00
parent be867ae5f1
commit 8695ecd82b
2 changed files with 2 additions and 2 deletions

View File

@@ -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 => {

Submodule syscall updated: eddcb80eb7...f3bb1f7b68