freebsd-ports/misc/mshell/files/patch-ab
Jean-Marc Zucconi 6ec4d9369d Use <termios.h> instead of <sgtty.h>
PR:		ports/110384
Submitted by:	Ed Schouten <ed@fxq.nl>
2007-04-14 12:17:55 +00:00

37 lines
759 B
Text

--- settatr.c.orig Mon Mar 26 14:59:01 2007
+++ settatr.c Mon Mar 26 15:00:41 2007
@@ -4,7 +4,7 @@
set_terminal_attributes()
{
-#ifdef BSD
+#if 0
struct sgttyb sg;
struct tchars tc;
struct ltchars lt;
@@ -33,20 +33,19 @@
lt.t_rprntc = '';
ioctl ( 0, TIOCSLTC, &lt );
#endif
-#ifdef SYSV
- struct termio t;
+#if 1
+ struct termios t;
- ioctl ( 0, TCGETA, &t );
+ tcgetattr(0, &t);
t.c_cc[VINTR] = '\003';
t.c_cc[VERASE] = '\b';
t.c_cc[VKILL] = '\025';
t.c_iflag = IGNBRK | IGNPAR | ICRNL | IXON ;
- t.c_oflag = OPOST | ONLCR ;
+ t.c_oflag = OPOST | ONLCR | OXTABS;
t.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK ;
- t.c_cflag |= TAB3;
- ioctl ( 0, TCSETA, &t );
+ tcsetattr(0, TCSANOW, &t);
#endif
}
set_resource_limits()