about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-08-10 12:05:53 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-08-10 12:05:53 +0200
commit305e6326a6508b263c6886ce67e503b15d4c3fe9 (patch)
tree30ac7a6168af6b8f954649490226aa4e861ab530 /src
parente98c7eaa0f0361539a5a979ffd78a0e96d773177 (diff)
downloadbox64-305e6326a6508b263c6886ce67e503b15d4c3fe9.tar.gz
box64-305e6326a6508b263c6886ce67e503b15d4c3fe9.zip
Small fix for Default and Ignore signal handling
Diffstat (limited to 'src')
-rwxr-xr-xsrc/libtools/signals.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libtools/signals.c b/src/libtools/signals.c
index 006f89ea..d4c88c01 100755
--- a/src/libtools/signals.c
+++ b/src/libtools/signals.c
@@ -267,7 +267,11 @@ static void sigstack_key_alloc() {
 uint64_t RunFunctionHandler(int* exit, x64_ucontext_t* sigcontext, uintptr_t fnc, int nargs, ...)
 {
     if(fnc==0 || fnc==1) {
-        printf_log(LOG_NONE, "BOX64: Warning, calling Signal function handler %s\n", fnc?"SIG_DFL":"SIG_IGN");
+        printf_log(LOG_NONE, "BOX64: Warning, calling Signal function handler %s\n", fnc?"SIG_IGN":"SIG_DFL");
+        if(fnc==0) {
+            printf_log(LOG_NONE, "Unhandled signal caught, aborting\n");
+            abort();
+        }
         return 0;
     }
 #ifdef HAVE_TRACE
@@ -1276,7 +1280,7 @@ void init_signal_helper(box64context_t* context)
 {
     // setup signal handling
     for(int i=0; i<MAX_SIGNAL; ++i) {
-        context->signals[i] = 1;    // SIG_DFL
+        context->signals[i] = 0;    // SIG_DFL
     }
 	struct sigaction action = {0};
 	action.sa_flags = SA_SIGINFO | SA_RESTART | SA_NODEFER;