diff options
-rw-r--r-- | fbcon.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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); |