summaryrefslogtreecommitdiffstats
path: root/lib/libcurses/tstp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcurses/tstp.c')
-rw-r--r--lib/libcurses/tstp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libcurses/tstp.c b/lib/libcurses/tstp.c
index 07debf4..f16a46c 100644
--- a/lib/libcurses/tstp.c
+++ b/lib/libcurses/tstp.c
@@ -54,7 +54,7 @@ __stop_signal_handler(signo)
sigset_t oset, set;
/* Get the current terminal state (which the user may have changed). */
- if (tcgetattr(STDIN_FILENO, &save))
+ if (tcgetattr(__tty_fileno, &save))
return;
/*
@@ -87,10 +87,10 @@ __stop_signal_handler(signo)
__set_stophandler();
/* save the new "default" terminal state */
- (void)tcgetattr(STDIN_FILENO, &__orig_termios);
+ (void)tcgetattr(__tty_fileno, &__orig_termios);
/* Reset the terminal state to the mode just before we stopped. */
- (void)tcsetattr(STDIN_FILENO, __tcaction ?
+ (void)tcsetattr(__tty_fileno, __tcaction ?
TCSASOFT | TCSADRAIN : TCSADRAIN, &save);
/* Restart the screen. */
@@ -122,3 +122,7 @@ __restore_stophandler()
{
(void)signal(SIGTSTP, otstpfn);
}
+
+/* For compatibility */
+
+void tstp() { __stop_signal_handler(SIGTSTP); }
OpenPOWER on IntegriCloud