diff options
| author | Bruce Evans <bde@FreeBSD.org> | 2019-03-29 15:57:08 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 2019-03-29 15:57:08 +0000 |
| commit | cfcc114dcbe06c3c4480e29b99c94d63eb76fba1 (patch) | |
| tree | ac3413d49bf091ba5c7fef23de7c837c7a3bbe2c /lib/libvgl/main.c | |
| parent | 0410dc5f5d0e2fdc36214c8ab499047f15b4270b (diff) | |
Notes
Diffstat (limited to 'lib/libvgl/main.c')
| -rw-r--r-- | lib/libvgl/main.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/libvgl/main.c b/lib/libvgl/main.c index 12f2c648d0e3..1408ddb53753 100644 --- a/lib/libvgl/main.c +++ b/lib/libvgl/main.c @@ -31,9 +31,9 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <signal.h> #include <stdio.h> #include <sys/types.h> -#include <sys/signal.h> #include <sys/file.h> #include <sys/ioctl.h> #include <sys/mman.h> @@ -107,14 +107,22 @@ struct vt_mode smode; } static void -VGLAbort(int arg __unused) +VGLAbort(int arg) { + sigset_t mask; + VGLAbortPending = 1; signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); - signal(SIGSEGV, SIG_IGN); - signal(SIGBUS, SIG_IGN); signal(SIGUSR2, SIG_IGN); + if (arg == SIGBUS || arg == SIGSEGV) { + signal(arg, SIG_DFL); + sigemptyset(&mask); + sigaddset(&mask, arg); + sigprocmask(SIG_UNBLOCK, &mask, NULL); + VGLEnd(); + kill(getpid(), arg); + } } static void |
