summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1998-06-19 16:14:30 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1998-06-19 16:14:30 +0000
commit87c7af1eb5ef9211f444f4ff204ca3cd00e04afb (patch)
tree3ceb007b8862b11e74672f0bd792461c0a587c75 /lib
parentc9168f59f06b084774c6a0dddd2cb3d46396cc7f (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libmytinfo/tty.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libmytinfo/tty.c b/lib/libmytinfo/tty.c
index 2ba2a7ccf905..9c22eb15f4e3 100644
--- a/lib/libmytinfo/tty.c
+++ b/lib/libmytinfo/tty.c
@@ -107,6 +107,8 @@ _check_tty() {
int
def_prog_mode() {
+ if (cur_term == NULL)
+ return ERR;
#ifdef USE_WINSZ
#ifdef TIOCGWINSZ
if (ioctl(cur_term->fd, TIOCGWINSZ, &cur_term->prog_winsz) < 0)
@@ -125,6 +127,8 @@ def_prog_mode() {
int
def_shell_mode() {
+ if (cur_term == NULL)
+ return ERR;
cur_term->termcap = 0;
#ifdef USE_WINSZ
#ifdef TIOCGWINSZ
@@ -139,8 +143,12 @@ def_shell_mode() {
#endif
}
+
+#pragma weak reset_prog_mode
int
reset_prog_mode() {
+ if (cur_term == NULL)
+ return ERR;
#ifdef USE_TERMIO
return ioctl(cur_term->fd, TCSETA, &cur_term->prog_mode)==0 ? OK : ERR;
#else
@@ -148,8 +156,11 @@ reset_prog_mode() {
#endif
}
+#pragma weak reset_shell_mode
int
reset_shell_mode() {
+ if (cur_term == NULL)
+ return ERR;
#ifdef USE_TERMIO
return ioctl(cur_term->fd, TCSETA, &cur_term->shell_mode)==0 ? OK : ERR;
#else