Gained knowledge from NewOS change 1930 and fixed the sig_block_mask change
as already suggested in my earlier comment. Added some comments. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6993 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -87,6 +87,10 @@ handle_signals(struct thread *thread, int state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToDo: it's not safe to call arch_setup_signal_frame with
|
||||||
|
// interrupts disabled since it writes to the user stack
|
||||||
|
// and may page fault.
|
||||||
|
|
||||||
// User defined signal handler
|
// User defined signal handler
|
||||||
dprintf("### Setting up custom signal handler frame...\n");
|
dprintf("### Setting up custom signal handler frame...\n");
|
||||||
arch_setup_signal_frame(thread, handler, sig, thread->sig_block_mask);
|
arch_setup_signal_frame(thread, handler, sig, thread->sig_block_mask);
|
||||||
@@ -94,8 +98,7 @@ handle_signals(struct thread *thread, int state)
|
|||||||
if (handler->sa_flags & SA_ONESHOT)
|
if (handler->sa_flags & SA_ONESHOT)
|
||||||
handler->sa_handler = SIG_DFL;
|
handler->sa_handler = SIG_DFL;
|
||||||
if (!(handler->sa_flags & SA_NOMASK))
|
if (!(handler->sa_flags & SA_NOMASK))
|
||||||
thread->sig_block_mask |= (handler->sa_mask | (1L << sig)) & BLOCKABLE_SIGS;
|
thread->sig_block_mask |= (handler->sa_mask | (1L << (sig - 1))) & BLOCKABLE_SIGS;
|
||||||
// ToDo: is that really (1L << sig) and not (1L << (sig-1)) ???
|
|
||||||
|
|
||||||
return global_resched;
|
return global_resched;
|
||||||
} else
|
} else
|
||||||
@@ -190,6 +193,8 @@ send_signal_etc(pid_t threadID, uint signal, uint32 flags)
|
|||||||
int
|
int
|
||||||
send_signal(pid_t threadID, uint signal)
|
send_signal(pid_t threadID, uint signal)
|
||||||
{
|
{
|
||||||
|
// The BeBook states that this function wouldn't be exported
|
||||||
|
// for drivers, but, of course, it's wrong.
|
||||||
return send_signal_etc(threadID, signal, 0);
|
return send_signal_etc(threadID, signal, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user