Handle sigaction[_etc]() return value correctly (it's not an error code).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36056 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -912,7 +913,7 @@ user_debug_exception_occurred(debug_exception_type exception, int signal)
|
|||||||
// the signal instead. An already installed debugger will be notified, if
|
// the signal instead. An already installed debugger will be notified, if
|
||||||
// it has requested notifications of signal.
|
// it has requested notifications of signal.
|
||||||
struct sigaction signalAction;
|
struct sigaction signalAction;
|
||||||
if (sigaction(signal, NULL, &signalAction) == B_OK
|
if (sigaction(signal, NULL, &signalAction) == 0
|
||||||
&& signalAction.sa_handler != SIG_DFL) {
|
&& signalAction.sa_handler != SIG_DFL) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2160,9 +2161,10 @@ debug_nub_thread(void *)
|
|||||||
restore_interrupts(state);
|
restore_interrupts(state);
|
||||||
|
|
||||||
// get the handler
|
// get the handler
|
||||||
if (result == B_OK) {
|
if (result == B_OK
|
||||||
result = sigaction_etc(threadID, signal, NULL,
|
&& sigaction_etc(threadID, signal, NULL,
|
||||||
&reply.get_signal_handler.handler);
|
&reply.get_signal_handler.handler) != 0) {
|
||||||
|
result = errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE(("nub thread %ld: B_DEBUG_MESSAGE_GET_SIGNAL_HANDLER: "
|
TRACE(("nub thread %ld: B_DEBUG_MESSAGE_GET_SIGNAL_HANDLER: "
|
||||||
|
|||||||
Reference in New Issue
Block a user