summaryrefslogtreecommitdiffstats
path: root/contrib/less/screen.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-04-17 07:16:34 +0000
committertjr <tjr@FreeBSD.org>2004-04-17 07:16:34 +0000
commit44c4d557e2436dfbb703a9fc3e78fac79c574d4b (patch)
treef46d7e51d83360c5b6bdacf5b08e16a415ed61b5 /contrib/less/screen.c
parentc0c85bc41cb6c023adae56cf0a7e3495bd528cb2 (diff)
downloadFreeBSD-src-44c4d557e2436dfbb703a9fc3e78fac79c574d4b.zip
FreeBSD-src-44c4d557e2436dfbb703a9fc3e78fac79c574d4b.tar.gz
Import less v381.
Diffstat (limited to 'contrib/less/screen.c')
-rw-r--r--contrib/less/screen.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/contrib/less/screen.c b/contrib/less/screen.c
index 485e548..8a8f6a3 100644
--- a/contrib/less/screen.c
+++ b/contrib/less/screen.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2000 Mark Nudelman
+ * Copyright (C) 1984-2002 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -229,6 +229,7 @@ extern int no_keypad;
extern int sigs;
extern int wscroll;
extern int screen_trashed;
+extern int tty;
#if HILITE_SEARCH
extern int hilite_search;
#endif
@@ -267,7 +268,7 @@ raw_mode(on)
/*
* Get terminal modes.
*/
- tcgetattr(2, &s);
+ tcgetattr(tty, &s);
/*
* Save modes and set certain variables dependent on modes.
@@ -423,9 +424,9 @@ raw_mode(on)
s = save_term;
}
#if HAVE_FSYNC
- fsync(2);
+ fsync(tty);
#endif
- tcsetattr(2, TCSADRAIN, &s);
+ tcsetattr(tty, TCSADRAIN, &s);
#if MUST_SET_LINE_DISCIPLINE
if (!on)
{
@@ -435,7 +436,7 @@ raw_mode(on)
* is therefore not restored, yet. Restore the old
* line discipline by hand.
*/
- ioctl(2, TIOCSETD, &save_term.c_line);
+ ioctl(tty, TIOCSETD, &save_term.c_line);
}
#endif
}
@@ -451,7 +452,7 @@ raw_mode(on)
/*
* Get terminal modes.
*/
- ioctl(2, TCGETA, &s);
+ ioctl(tty, TCGETA, &s);
/*
* Save modes and set certain variables dependent on modes.
@@ -487,7 +488,7 @@ raw_mode(on)
*/
s = save_term;
}
- ioctl(2, TCSETAW, &s);
+ ioctl(tty, TCSETAW, &s);
}
#else
#ifdef TIOCGETP
@@ -501,7 +502,7 @@ raw_mode(on)
/*
* Get terminal modes.
*/
- ioctl(2, TIOCGETP, &s);
+ ioctl(tty, TIOCGETP, &s);
/*
* Save modes and set certain variables dependent on modes.
@@ -530,7 +531,7 @@ raw_mode(on)
*/
s = save_term;
}
- ioctl(2, TIOCSETN, &s);
+ ioctl(tty, TIOCSETN, &s);
}
#else
#ifdef _OSK
@@ -544,7 +545,7 @@ raw_mode(on)
/*
* Get terminal modes.
*/
- _gs_opt(2, &s);
+ _gs_opt(tty, &s);
/*
* Save modes and set certain variables dependent on modes.
@@ -572,7 +573,7 @@ raw_mode(on)
*/
s = save_term;
}
- _ss_opt(2, &s);
+ _ss_opt(tty, &s);
}
#else
/* MS-DOS, Windows, or OS2 */
OpenPOWER on IntegriCloud