diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-02-25 19:09:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-02-25 19:09:49 +0000 |
commit | d44fe623968310c5c8b668113425b8ac1172df35 (patch) | |
tree | 15f2b79f6f2edc49acdd6101ddd02ab5a26e82d3 /usr.bin/mg/ttyio.c | |
parent | 998d769a0cf8bef7d4ca0d26945c151a23b542ec (diff) |
make it minimally compile; millert
Diffstat (limited to 'usr.bin/mg/ttyio.c')
-rw-r--r-- | usr.bin/mg/ttyio.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/mg/ttyio.c b/usr.bin/mg/ttyio.c index c3ddf420ef9..7cd8c7978b7 100644 --- a/usr.bin/mg/ttyio.c +++ b/usr.bin/mg/ttyio.c @@ -19,15 +19,15 @@ #include <sys/types.h> #include <fcntl.h> -#include <termio.h> +#include <termios.h> #define NOBUF 512 /* Output buffer size. */ char obuf[NOBUF]; /* Output buffer. */ int nobuf; /* buffer count */ -static struct termio ot; /* entry state of the terminal */ -static struct termio nt; /* editor's terminal state */ +static struct termios ot; /* entry state of the terminal */ +static struct termios nt; /* editor's terminal state */ static int ttyactivep = FALSE; /* terminal in editor mode? */ static int ttysavedp = FALSE; /* terminal state saved? */ @@ -58,7 +58,7 @@ ttopen() if( !ttysavedp ) { - if (ioctl(0, TCGETA, &ot) < 0) + if (tcgetattr(0, &ot) < 0) abort(); nt = ot; /* save entry state */ nt.c_cc[VMIN] = 1; /* one character read is OK */ @@ -75,7 +75,7 @@ ttopen() ttysavedp = TRUE; } - if (ioctl(0, TCSETAF, &nt) < 0) + if (tcsetattr(0, TCSAFLUSH, &nt) < 0) abort(); /* This really belongs in tty/termcap... */ @@ -126,7 +126,8 @@ ttclose() if(!ttysavedp || !ttyactivep) return; ttflush(); - if (ioctl(0, TCSETAF, &ot) < 0 || fcntl( 0, F_SETFL, kbdflgs ) < 0) + if (tcsetattr(0, TCSAFLUSH, &ot) < 0 || + fcntl( 0, F_SETFL, kbdflgs ) < 0) abort(); ttyactivep = FALSE; } @@ -251,8 +252,6 @@ static void alrm() ttwait() { - int alrm(); - if (kbdqp) return FALSE; /* already pending input */ if (setjmp(tohere)) |