mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Add check for non-NULL cur_term
Add #pragma weak for reset_*_mode() they will be replaced in libncurses
This commit is contained in:
parent
6ebaa024df
commit
7bc8e89840
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37056
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user