Commit ac899e5f authored by Chris Allegretta's avatar Chris Allegretta
Browse files

do_suspend() - Added _POSIX_VDISABLE macro to fully ignore suspend keystroke....

do_suspend() - Added _POSIX_VDISABLE macro to fully ignore suspend keystroke. Eliminates the possibility that nano can be suspended when it's not supposed to be


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@703 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent d173c15c
No related merge requests found
Showing with 17 additions and 0 deletions
+17 -0
......@@ -118,6 +118,10 @@ Cvs code -
- Don't try to play with the handler inside the handler. Just
raise a SIGSTOP. We also now write the "use "fg"" message to
stdout instead of stderr.
- Added _POSIX_VDISABLE macro to fully ignore suspend keystroke.
Eliminates the possibility that nano can be suspended when
it's not supposed to be. Many many many thanks to Jordi and
Tom Lear for helping out finding and fixing this bug!
do_cont()
- Now just does a refresh call instead of playing with the SIGTSTP
handler.
......
......@@ -1740,6 +1740,9 @@ void handle_sigwinch(int s)
void signal_init(void)
{
#ifdef _POSIX_VDISABLE
struct termios term;
#endif
/* Trap SIGINT and SIGQUIT cuz we want them to do useful things. */
memset(&act, 0, sizeof(struct sigaction));
......@@ -1754,7 +1757,17 @@ void signal_init(void)
sigaction(SIGWINCH, &act, NULL);
if (!ISSET(SUSPEND)) {
/* Insane! */
#ifdef _POSIX_VDISABLE
tcgetattr(0, &term);
term.c_cc[VSUSP] = _POSIX_VDISABLE;
tcsetattr(0, TCSANOW, &term);
#else
act.sa_handler = SIG_IGN;
sigaction(SIGTSTP, &act, NULL);
#endif
} else {
/* if we don't do this, it seems other stuff interrupts the
suspend handler! Try using nano with mutt without this line */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment