From 6f33e7286f0f1e9c8af24913cd1e00dce6223d72 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 6 Apr 2010 20:24:23 +0000 Subject: [PATCH] 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 --- src/system/kernel/debug/user_debugger.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/debug/user_debugger.cpp b/src/system/kernel/debug/user_debugger.cpp index f77693a71e..f817f0d842 100644 --- a/src/system/kernel/debug/user_debugger.cpp +++ b/src/system/kernel/debug/user_debugger.cpp @@ -4,6 +4,7 @@ */ +#include #include #include #include @@ -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 // it has requested notifications of signal. struct sigaction signalAction; - if (sigaction(signal, NULL, &signalAction) == B_OK + if (sigaction(signal, NULL, &signalAction) == 0 && signalAction.sa_handler != SIG_DFL) { return true; } @@ -2160,9 +2161,10 @@ debug_nub_thread(void *) restore_interrupts(state); // get the handler - if (result == B_OK) { - result = sigaction_etc(threadID, signal, NULL, - &reply.get_signal_handler.handler); + if (result == B_OK + && sigaction_etc(threadID, signal, NULL, + &reply.get_signal_handler.handler) != 0) { + result = errno; } TRACE(("nub thread %ld: B_DEBUG_MESSAGE_GET_SIGNAL_HANDLER: "