signals: upon a crash, save changed buffers and reset terminal state
Upon a segmentation fault or an abort signal, instead of crashing, losing all changes, and leaving the terminal in curses mode, nano now calls die(), to save any changed buffers and to restore the terminal to a usable state. For the remote chance that nano segfaults in die(), the handler for SIGSEGV and for SIGABRT is reset to its default value as soon as the signal fires, to prevent a crash-handler loop. Since a core dump is usually more helpful for debugging, the crash handler is not included in a debug build. This addresses https://savannah.gnu.org/patch/?9623 . Signed-off-by:Devin Hussey <husseydevin@gmail.com>
Showing
+21 -0
Please register or sign in to comment