summaryrefslogtreecommitdiffstats
path: root/editors/em/files
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2007-03-21 09:58:57 +0000
committermiwi <miwi@FreeBSD.org>2007-03-21 09:58:57 +0000
commita4828151a73030b8244d54d3de496eef58f55c79 (patch)
tree0d9f6d1c947bda3e12c807b3ceb2b4713addfee0 /editors/em/files
parent3eedccb771c9ec2e8d1d196c8a3c72d771ba0e86 (diff)
downloadFreeBSD-ports-a4828151a73030b8244d54d3de496eef58f55c79.zip
FreeBSD-ports-a4828151a73030b8244d54d3de496eef58f55c79.tar.gz
- Use <termios.h> instead of <sgtty.h>
PR: 110448 Submitted by: Ed Schouten <ed@fxq.nl>
Diffstat (limited to 'editors/em/files')
-rw-r--r--editors/em/files/patch-termio.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/editors/em/files/patch-termio.c b/editors/em/files/patch-termio.c
new file mode 100644
index 0000000..a252aa1
--- /dev/null
+++ b/editors/em/files/patch-termio.c
@@ -0,0 +1,58 @@
+--- termio.c Thu May 2 13:52:00 1996
++++ termio.c Sat Mar 17 16:53:22 2007
+@@ -41,16 +41,21 @@
+ int nxtchar = -1; /* character held from type ahead */
+ #endif
+
++#undef USG
++#define USG 1
++#undef BSD
++#define BSD 0
++
+ #if USG /* System V */
+ #include <signal.h>
+-#include <termio.h>
++#include <termios.h>
+ #include <fcntl.h>
+ int kbdflgs; /* saved keyboard fd flags */
+ int kbdpoll; /* in O_NDELAY mode */
+ int kbdqp; /* there is a char in kbdq */
+ char kbdq; /* char we've already read */
+-struct termio otermio; /* original terminal characteristics */
+-struct termio ntermio; /* charactoristics to use inside */
++struct termios otermio; /* original terminal characteristics */
++struct termios ntermio; /* charactoristics to use inside */
+ #if XONXOFF
+ #define XXMASK 0016000
+ #endif
+@@ -154,7 +159,7 @@
+ #endif
+
+ #if USG
+- ioctl(0, TCGETA, &otermio); /* save old settings */
++ tcgetattr(0, &otermio); /* save old settings */
+ ntermio.c_iflag = 0; /* setup new settings */
+ #if XONXOFF
+ ntermio.c_iflag = otermio.c_iflag & XXMASK; /* save XON/XOFF P.K. */
+@@ -162,11 +167,10 @@
+ ntermio.c_oflag = 0;
+ ntermio.c_cflag = otermio.c_cflag;
+ ntermio.c_lflag = 0;
+- ntermio.c_line = otermio.c_line;
+ ntermio.c_cc[VMIN] = 1;
+ ntermio.c_cc[VTIME] = 0;
+ #if PKCODE
+- ioctl(0, TCSETAW, &ntermio); /* and activate them */
++ tcsetattr(0, TCSANOW, &ntermio); /* and activate them */
+ #else
+ ioctl(0, TCSETA, &ntermio); /* and activate them */
+ #endif
+@@ -244,7 +248,7 @@
+
+ #if USG
+ #if PKCODE
+- ioctl(0, TCSETAW, &otermio); /* restore terminal settings */
++ tcsetattr(0, TCSANOW, &otermio); /* and activate them */
+ #else
+ ioctl(0, TCSETA, &otermio); /* restore terminal settings */
+ #endif
OpenPOWER on IntegriCloud