From: Sam Leffler Date: Sun, 26 Jun 1983 13:34:26 +0000 (-0800) Subject: fix for new signals X-Git-Tag: BSD-4_2-Snapshot-Development~1329 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/7e8a26857e06a0fa28e377df5156038275410131 fix for new signals SCCS-vsn: lib/libcurses/tstp.c 1.3 --- diff --git a/usr/src/lib/libcurses/tstp.c b/usr/src/lib/libcurses/tstp.c index ce066ee685..b71a61f600 100644 --- a/usr/src/lib/libcurses/tstp.c +++ b/usr/src/lib/libcurses/tstp.c @@ -12,6 +12,7 @@ tstp() { # ifdef SIGTSTP SGTTY tty; + int omask; # ifdef DEBUG if (outf) fflush(outf); @@ -20,7 +21,12 @@ tstp() { mvcur(0, COLS - 1, LINES - 1, 0); endwin(); fflush(stdout); + /* reset signal handler so kill below stops us */ + signal(SIGTSTP, SIG_DFL); +#define mask(s) (1 << ((s)-1)) + omask = sigsetmask(sigblock(0) &~ mask(SIGTSTP)); kill(0, SIGTSTP); + sigblock(mask(SIGTSTP)); signal(SIGTSTP, tstp); _tty = tty; stty(_tty_ch, &_tty);