[haiku-commits] r36056 - haiku/trunk/src/system/kernel/debug

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 6 Apr 2010 22:24:24 +0200 (CEST)

Author: bonefish
Date: 2010-04-06 22:24:23 +0200 (Tue, 06 Apr 2010)
New Revision: 36056
Changeset: http://dev.haiku-os.org/changeset/36056/haiku

Modified:
   haiku/trunk/src/system/kernel/debug/user_debugger.cpp
Log:
Handle sigaction[_etc]() return value correctly (it's not an error code).


Modified: haiku/trunk/src/system/kernel/debug/user_debugger.cpp
===================================================================
--- haiku/trunk/src/system/kernel/debug/user_debugger.cpp       2010-04-06 
20:23:41 UTC (rev 36055)
+++ haiku/trunk/src/system/kernel/debug/user_debugger.cpp       2010-04-06 
20:24:23 UTC (rev 36056)
@@ -4,6 +4,7 @@
  */
 
 
+#include <errno.h>
 #include <signal.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -912,7 +913,7 @@
        // 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 @@
                                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: "


Other related posts:

  • » [haiku-commits] r36056 - haiku/trunk/src/system/kernel/debug - ingo_weinhold