signals: don't trap segfault/abort when envvar NANO_NOCATCH is defined
When the user wants to get a backtrace, the crash handler shouldn't kick in.master
parent
e889c28a95
commit
c0b15c2982
|
@ -309,6 +309,10 @@ not by default distinguish modified from unmodified arrow keys.
|
||||||
Please report any other bugs that you encounter via:
|
Please report any other bugs that you encounter via:
|
||||||
.br
|
.br
|
||||||
\fIhttps://savannah.gnu.org/bugs/?group=nano\fR.
|
\fIhttps://savannah.gnu.org/bugs/?group=nano\fR.
|
||||||
|
.sp
|
||||||
|
When nano crashes, it will save any modified buffers to emergency .save files.
|
||||||
|
If you are able to reproduce the crash and you want to get a backtrace, define
|
||||||
|
the environment variable \fBNANO_NOCATCH\fR.
|
||||||
|
|
||||||
.SH HOMEPAGE
|
.SH HOMEPAGE
|
||||||
\fIhttps://nano-editor.org/\fR
|
\fIhttps://nano-editor.org/\fR
|
||||||
|
|
|
@ -1213,6 +1213,7 @@ void signal_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
|
if (getenv("NANO_NOCATCH") == NULL) {
|
||||||
/* Trap SIGSEGV and SIGABRT to save any changed buffers and reset
|
/* Trap SIGSEGV and SIGABRT to save any changed buffers and reset
|
||||||
* the terminal to a usable state. Reset these handlers to their
|
* the terminal to a usable state. Reset these handlers to their
|
||||||
* defaults as soon as their signal fires. */
|
* defaults as soon as their signal fires. */
|
||||||
|
@ -1220,6 +1221,7 @@ void signal_init(void)
|
||||||
act.sa_flags |= SA_RESETHAND;
|
act.sa_flags |= SA_RESETHAND;
|
||||||
sigaction(SIGSEGV, &act, NULL);
|
sigaction(SIGSEGV, &act, NULL);
|
||||||
sigaction(SIGABRT, &act, NULL);
|
sigaction(SIGABRT, &act, NULL);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue