Date: Fri, 28 Dec 2007 15:32:33 +0100 (CET) From: Ed Schouten <ed@fxq.nl> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/119103: [Patch] make net/tintin++ and japanese/tintin++ work without sgtty Message-ID: <20071228143233.B198F1CCD9@palm.hoeg.nl> Resent-Message-ID: <200712281440.lBSEe1uw095184@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 119103 >Category: ports >Synopsis: [Patch] make net/tintin++ and japanese/tintin++ work without sgtty >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Dec 28 14:40:00 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Ed Schouten >Release: FreeBSD 6.3-PRERELEASE i386 >Organization: >Environment: System: FreeBSD palm.hoeg.nl 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Wed Dec 19 16:07:46 CET 2007 ed@palm.hoeg.nl:/usr/obj/usr/src/sys/PALM i386 >Description: The net/tintin++ port still makes use of the sgtty interface. We'd better port it to termios to make it work with COMPAT_43TTY-less kernels. >How-To-Repeat: >Fix: --- net/tintin++/files/patch-ad 2002-08-23 21:35:21.000000000 +0200 +++ net/tintin++/files/patch-ad 2007-12-28 15:30:19.000000000 +0100 @@ -1,23 +1,21 @@ --- main.c.orig Thu Mar 25 11:26:53 1999 +++ main.c Tue Sep 26 17:27:58 2000 -@@ -18,6 +18,7 @@ - #include <signal.h> - #include "tintin.h" - #include <fcntl.h> -+#include <termios.h> +@@ -100,12 +100,8 @@ + extern void term_echo(); - #ifndef BADSIG - #define BADSIG (void (*)())-1 -@@ -109,7 +110,7 @@ + int last_line_length; +-#if defined(HAVE_SYS_TERMIO_H) && !defined(BSD_ECHO) || defined(HAVE_TERMIO_H) +-#if defined(HAVE_SYS_TERMIO_H) +-#include <sys/termio.h> +-#else +-#include <termio.h> +-#endif ++#if 1 ++#include <termios.h> tcflag_t c_lflag; cc_t c_cc[NCCS]; #else --unsigned char c_cc[NCC]; -+unsigned char c_cc[NCCS]; - unsigned short c_lflag; - #endif - -@@ -580,7 +581,7 @@ +@@ -580,7 +576,7 @@ if(ses->logfile) { if (!OLD_LOG) { count=0; @@ -26,7 +24,7 @@ if (buffer[n]!='\r') { temp[count]=buffer[n]; count++; -@@ -750,7 +751,7 @@ +@@ -750,7 +746,7 @@ sprintf(strng,"%c8%s\n\r%c7%c[%d;%df", E, cptr, E, E, input_row, input_col); else sprintf(strng,"%s\n\r", cptr); @@ -35,7 +33,7 @@ display_col=1; if (redraw && term_echoing && !is_split) write(1, k_input, strlen(k_input)); -@@ -806,7 +807,7 @@ +@@ -806,7 +802,7 @@ cptr++; sprintf(strng,"%s\n\r", cptr); } @@ -44,7 +42,7 @@ display_col=1; } text_came=TRUE; -@@ -876,7 +877,7 @@ +@@ -876,7 +872,7 @@ input_col=1; sprintf(fn, "%c[2J%c[1;%dr%c[%d;1f", E, E, display_row, E, split_line); write(1,fn, strlen(fn)); --- net/tintin++/files/patch-term.c 1970-01-01 01:00:00.000000000 +0100 +++ net/tintin++/files/patch-term.c 2007-12-28 15:30:19.000000000 +0100 @@ -0,0 +1,79 @@ +--- echo.c 1999-03-04 19:23:42.000000000 +0100 ++++ echo.c 2007-12-28 15:23:31.000000000 +0100 +@@ -18,12 +18,8 @@ + #include <sys/ioctl.h> + #endif + +-#if defined(HAVE_SYS_TERMIO_H) && !defined(BSD_ECHO) || defined(HAVE_TERMIO_H) +-#if defined(HAVE_SYS_TERMIO_H) +-#include <sys/termio.h> +-#else +-#include <termio.h> +-#endif ++#if 1 ++#include <termios.h> + #else + #include <sgtty.h> + #if DIRTY_REDEFINE +@@ -34,8 +30,8 @@ + #endif + #endif + +-#if defined(HAVE_SYS_TERMIO_H) && !defined(BSD_ECHO) || defined(HAVE_TERMIO_H) +-#ifdef HAVE_TCFLAG_T ++#if 1 ++#if 1 + extern tcflag_t c_lflag; + extern cc_t c_cc[NCCS]; + #else +@@ -44,10 +40,10 @@ + #endif + void init_echo() + { +- struct termio io; ++ struct termios io; + +- if(ioctl(0, TCGETA, &io)<0) +- syserr("ioctl"); ++ if(tcgetattr(0, &io)<0) ++ syserr("tcgetattr"); + c_lflag = io.c_lflag; + c_cc[VMIN] = io.c_cc[VMIN]; + c_cc[VTIME] = io.c_cc[VTIME]; +@@ -58,14 +54,14 @@ + /********************************/ + void term_echo() + { +- struct termio io; ++ struct termios io; + +- if(ioctl(0, TCGETA, &io)<0) ++ if(tcgetattr(0, &io)<0) + syserr("ioctl"); + io.c_lflag = c_lflag; + io.c_cc[VMIN] = c_cc[VMIN]; + io.c_cc[VTIME] = c_cc[VTIME]; +- if(ioctl(0, TCSETA, &io)<0) ++ if(tcsetattr(0, TCSANOW, &io)<0) + syserr("ioctl"); + } + +@@ -74,15 +70,15 @@ + /*********************************/ + void term_noecho() + { +- struct termio io; ++ struct termios io; + +- if(ioctl(0, TCGETA, &io)<0) ++ if(tcgetattr(0, &io)<0) + syserr("ioctl"); + io.c_lflag &= ~ECHO; + io.c_lflag &= ~ICANON; + io.c_cc[VMIN]=1; + io.c_cc[VTIME]=0; +- if(ioctl(0, TCSETA, &io) < 0) ++ if(tcsetattr(0, TCSANOW, &io) < 0) + syserr("ioctl"); + } + >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071228143233.B198F1CCD9>