From 9083af04df4d0c2239fd843adf5bea6f349de8b3 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 27 Nov 2015 10:52:24 -0800 Subject: [PATCH] Terminate on SIGTSTP. --- vere/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vere/main.c b/vere/main.c index 22d1060b46..298320f358 100644 --- a/vere/main.c +++ b/vere/main.c @@ -371,6 +371,13 @@ report(void) printf("libuv: %s\n", uv_version_string()); } +void +_stop_exit(c3_i int_i) +{ + fprintf(stderr, "\r\n[received keyboard stop signal, exiting]\r\n"); + u3_lo_bail(); +} + c3_i main(c3_i argc, c3_c** argv) @@ -423,6 +430,10 @@ main(c3_i argc, } } + // Handle SIGTSTP as if it was SIGTERM. + // + signal(SIGTSTP, _stop_exit); + printf("~\n"); // printf("welcome.\n"); printf("urbit: home is %s\n", u3_Host.dir_c);