summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2008-06-19 08:07:27 +0000
committerEd Schouten <ed@FreeBSD.org>2008-06-19 08:07:27 +0000
commit556374bb28977fd2ef0b900bdee0887a7bd45bc1 (patch)
tree4533a807a5cfa4732606b40de1ba53e8ba61350a /editors
parentDon't install rtelnet when sgtty is not available anymore. (diff)
Make editors/beav use termios instead of sgtty.
The editors/beav port got broken on -CURRENT by the removal of the sgtty programming interface. Patch this port to use termios. The source code already contained support for termios, but was mistakenly covered by #ifdef __GLIBC__. Approved by: philip (mentor)
Notes
Notes: svn path=/head/; revision=215243
Diffstat (limited to 'editors')
-rw-r--r--editors/beav/Makefile1
-rw-r--r--editors/beav/files/patch-tcap.c18
-rw-r--r--editors/beav/files/patch-termio.c92
3 files changed, 98 insertions, 13 deletions
diff --git a/editors/beav/Makefile b/editors/beav/Makefile
index 19ef7c54a747..819898bd081c 100644
--- a/editors/beav/Makefile
+++ b/editors/beav/Makefile
@@ -7,6 +7,7 @@
PORTNAME= beav
PORTVERSION= 1.40.18
+PORTREVISION= 1
CATEGORIES= editors
MASTER_SITES= ${MASTER_SITE_DEBIAN_POOL}
DISTNAME= ${PORTNAME}_${PORTVERSION:R}.orig
diff --git a/editors/beav/files/patch-tcap.c b/editors/beav/files/patch-tcap.c
index 596f3af5d9b1..063e3dcf2802 100644
--- a/editors/beav/files/patch-tcap.c
+++ b/editors/beav/files/patch-tcap.c
@@ -1,11 +1,11 @@
---- tcap.c.orig Sat Dec 13 17:34:59 1997
-+++ tcap.c Thu Mar 21 03:53:02 2002
-@@ -39,7 +39,7 @@
+--- tcap.c
++++ tcap.c
+@@ -89,7 +89,7 @@
+
#ifdef BSD
- #include <sys/ioctl.h>
--struct winsize ttysize;
-+struct ttysize ttysize;
- #endif /* BSD */
- #ifdef ULTRIX
- struct winsize ttysize;
+-#ifdef ULTRIX
++#if 1
+ if (ioctl (0, TIOCGWINSZ, &ttysize) == 0
+ && ttysize.ws_row > 0)
+ {
diff --git a/editors/beav/files/patch-termio.c b/editors/beav/files/patch-termio.c
index d499953af842..67c3d5640471 100644
--- a/editors/beav/files/patch-termio.c
+++ b/editors/beav/files/patch-termio.c
@@ -1,12 +1,96 @@
---- termio.c.orig Sat Jul 21 22:35:05 2001
-+++ termio.c Thu Mar 21 03:52:16 2002
-@@ -12,6 +12,9 @@
+--- termio.c
++++ termio.c
+@@ -14,6 +14,9 @@
#include <signal.h>
#ifdef BSD
#include <sys/ioctl.h>
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
++#if defined(__OpenBSD__) || defined(__NetBSD__)
+#include <sys/ioctl_compat.h>
+#endif
#else
#ifdef OS2
#ifndef __EMX__
+@@ -44,7 +47,7 @@
+ int kbdqp; /* there is a char in kbdq */
+ char kbdq; /* char we've already read */
+
+-#ifdef BSD
++#if 0
+ struct sgttyb otermb;
+ struct sgttyb ntermb;
+ #else
+@@ -58,8 +61,8 @@
+ struct sgttyb ntermio; /* charactoristics to use inside */
+ struct tchars tchars, tcharsorig;
+ #else
+-#ifdef __GLIBC__
+-#include <sys/ioctl.h>
++#if 1
++#include <termios.h>
+ struct termios otermio;
+ struct termios ntermio;
+ #else
+@@ -86,7 +89,7 @@
+ void
+ ttopen ()
+ {
+-#ifdef BSD
++#if 0
+ #ifdef ULTRIX
+ struct winsize ttysize;
+ #else
+@@ -137,7 +140,9 @@
+ tchars.t_stopc = tchars.t_eofc = tchars.t_brkc = -1;
+ ioctl (0, TIOCSETC, &tchars);
+ #else
+-#ifdef __GLIBC__
++ struct winsize ttysize;
++
++#if 1
+ tcgetattr(0,&otermio);
+ #else
+ ioctl (0, TCGETA, &otermio);/* save old settings */
+@@ -149,7 +154,7 @@
+ ntermio.c_lflag = 0;
+ ntermio.c_cc[VMIN] = 1;
+ ntermio.c_cc[VTIME] = 0;
+-#ifdef __GLIBC__
++#if 1
+ tcsetattr(0,TCSANOW,&ntermio);
+ #else
+ ioctl (0, TCSETAW, &ntermio); /* and activate them */
+@@ -161,8 +166,14 @@
+ /* on all screens we are not sure of the initial position of the cursor */
+ ttrow = 999;
+ ttcol = 999;
+- nrow = NROW;
+- ncol = NCOL;
++ if (ioctl (0, TIOCGWINSZ, &ttysize) == 0)
++ {
++ nrow = ttysize.ws_row;
++ ncol = ttysize.ws_col;
++ } else {
++ nrow = NROW;
++ ncol = NCOL;
++ }
+ #endif /* BSD */
+ }
+
+@@ -174,7 +185,7 @@
+ void
+ ttclose ()
+ {
+-#ifdef BSD
++#if 0
+ if (ioctl (0, TIOCSETP, &otermb) == -1) /* restore terminal settings */
+ printf ("closing ioctl on dev 0 failure, error = %d\n", errno);
+ #else
+@@ -186,7 +197,7 @@
+ ioctl (0, TIOCSETC, &tcharsorig) == -1)
+ printf ("closing ioctl on dev 0 failure, error = %d\n", errno);
+ #else
+-#ifdef __GLIBC__
++#if 1
+ if( tcsetattr(0,TCSANOW,&otermio) == -1)
+ #else
+ if (ioctl (0, TCSETAW, &otermio) == -1) /* restore terminal settings */