From: NeilBrown Date: Tue, 12 Feb 2013 04:00:38 +0000 (+1100) Subject: vpatch: allow relevant signals to cause a core-dump. X-Git-Tag: v1.0~66 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=7e6e3397189dd396e0a9c03ed234486da841761e;p=wiggle.git vpatch: allow relevant signals to cause a core-dump. We catch SIGBUS and SIGSEGV so the terminal can be reset. But that means we don't see a core dump if there should be one. So for those signals, clear the signal handler after reseting the terminal, and return. Then the core will be dumped. Reported-by: Paul Wise --- diff --git a/vpatch.c b/vpatch.c index 5a947dc..c7e84a6 100644 --- a/vpatch.c +++ b/vpatch.c @@ -2780,7 +2780,12 @@ static void catch(int sig) nl(); endwin(); printf("Died on signal %d\n", sig); - exit(2); + fflush(stdout); + if (sig != SIGBUS && sig != SIGSEGV) + exit(2); + else + /* Otherwise return and die */ + signal(sig, NULL); } static void term_init(void)