VDSUSP fix from 1.0 tree

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@931 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Chris Allegretta 2001-12-17 04:34:23 +00:00
parent 5fd6cacfa5
commit 0bb70dcda5
3 changed files with 29 additions and 5 deletions

View File

@ -1,4 +1,11 @@
CVS code - CVS code -
- nano.c:
do_cont()
- Run signal_init() after doupdate() so ^Y wont suddenly
start suspending after returning from ^Z suspend in Hurd.
signal_init()
- Unconditionally disable VDSUSP if it exists, stops ^Y
suspending nano on the Hurd.
nano-1.1.4 - 12/11/2001 nano-1.1.4 - 12/11/2001
- General - General

26
nano.c
View File

@ -1937,6 +1937,9 @@ RETSIGTYPE do_cont(int signal)
SIGTSTP handler */ SIGTSTP handler */
doupdate(); doupdate();
/* The Hurd seems to need this, otherwise a ^Y after a ^Z will
start suspending again */
signal_init();
} }
void handle_sigwinch(int s) void handle_sigwinch(int s)
@ -2033,18 +2036,25 @@ void signal_init(void)
act.sa_handler = handle_sigwinch; act.sa_handler = handle_sigwinch;
sigaction(SIGWINCH, &act, NULL); sigaction(SIGWINCH, &act, NULL);
#ifdef _POSIX_VDISABLE
tcgetattr(0, &term);
#ifdef VDSUSP
term.c_cc[VDSUSP] = _POSIX_VDISABLE;
#endif /* VDSUSP */
#endif /* _POSIX_VDISABLE */
if (!ISSET(SUSPEND)) { if (!ISSET(SUSPEND)) {
/* Insane! */ /* Insane! */
#ifdef _POSIX_VDISABLE #ifdef _POSIX_VDISABLE
tcgetattr(0, &term);
term.c_cc[VSUSP] = _POSIX_VDISABLE; term.c_cc[VSUSP] = _POSIX_VDISABLE;
tcsetattr(0, TCSANOW, &term); #else
#endif
/* The HURD seems to need this anyway! */
act.sa_handler = SIG_IGN; act.sa_handler = SIG_IGN;
sigaction(SIGTSTP, &act, NULL); sigaction(SIGTSTP, &act, NULL);
#endif
} else { } else {
/* if we don't do this, it seems other stuff interrupts the /* if we don't do this, it seems other stuff interrupts the
@ -2058,6 +2068,12 @@ void signal_init(void)
sigaction(SIGCONT, &act, NULL); sigaction(SIGCONT, &act, NULL);
} }
#ifdef _POSIX_VDISABLE
tcsetattr(0, TCSANOW, &term);
#endif
} }
void window_init(void) void window_init(void)

View File

@ -133,6 +133,7 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace, int *list)
char *real_dir_from_tilde(char *buf); char *real_dir_from_tilde(char *buf);
void shortcut_init(int unjustify); void shortcut_init(int unjustify);
void signal_init(void);
void lowercase(char *src); void lowercase(char *src);
void blank_bottombars(void); void blank_bottombars(void);
void check_wrap(filestruct * inptr, char ch); void check_wrap(filestruct * inptr, char ch);