diff --git a/pkg/urbit/daemon/main.c b/pkg/urbit/daemon/main.c index e8912b49a..cd9b6ee77 100644 --- a/pkg/urbit/daemon/main.c +++ b/pkg/urbit/daemon/main.c @@ -509,10 +509,10 @@ _stop_exit(c3_i int_i) u3_daemon_bail(); } -/* _stop_trace(): print trace on SIGABRT. +/* _stop_signal(): handle termination signal. */ static void -_stop_trace(c3_i int_i) +_stop_signal(c3_i int_i) { // if we have a pier, unmap the event log before dumping core // @@ -673,7 +673,7 @@ main(c3_i argc, // Cleanup on SIGABRT. // - signal(SIGABRT, _stop_trace); + signal(SIGABRT, _stop_signal); printf("~\n"); // printf("welcome.\n"); diff --git a/pkg/urbit/vere/daemon.c b/pkg/urbit/vere/daemon.c index 506d3a697..75792df98 100644 --- a/pkg/urbit/vere/daemon.c +++ b/pkg/urbit/vere/daemon.c @@ -750,6 +750,19 @@ _daemon_sign_init(void) sig_u->nex_u = u3_Host.sig_u; u3_Host.sig_u = sig_u; } + + // handle SIGQUIT (turn it into SIGABRT) + // + { + u3_usig* sig_u; + + sig_u = c3_malloc(sizeof(u3_usig)); + uv_signal_init(u3L, &sig_u->sil_u); + + sig_u->num_i = SIGQUIT; + sig_u->nex_u = u3_Host.sig_u; + u3_Host.sig_u = sig_u; + } } /* _daemon_sign_cb: signal callback. @@ -778,6 +791,10 @@ _daemon_sign_cb(uv_signal_t* sil_u, c3_i num_i) u3_term_ef_winc(); break; } + + case SIGQUIT: { + abort(); + } } }