summaryrefslogtreecommitdiff
path: root/fbcon.c
diff options
context:
space:
mode:
Diffstat (limited to 'fbcon.c')
-rw-r--r--fbcon.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fbcon.c b/fbcon.c
index e92b063..7f0fb63 100644
--- a/fbcon.c
+++ b/fbcon.c
@@ -61,6 +61,15 @@ static int get_fb_size(struct uudisp *d)
return 0;
}
+static struct uudisp *display;
+
+static void fatalsignal(int sig)
+{
+ uudisp_close(display);
+ signal(sig, SIG_DFL);
+ raise(sig);
+}
+
static void dummy(int x)
{
}
@@ -185,6 +194,14 @@ int uudisp_open(struct uudisp *d)
signal(SIGTTIN, SIG_IGN);
signal(SIGTTOU, SIG_IGN);
+ display = d;
+ signal(SIGINT, fatalsignal);
+ signal(SIGTERM, fatalsignal);
+ signal(SIGSEGV, fatalsignal);
+ signal(SIGBUS, fatalsignal);
+ signal(SIGABRT, fatalsignal);
+ signal(SIGFPE, fatalsignal);
+
return 0;
error:
if (p->b.vidmem != MAP_FAILED) munmap(p->b.vidmem, fix.smem_len);