From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Jan 27 21:10:03 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F95C16A468 for ; Sun, 27 Jan 2008 21:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4189613C465 for ; Sun, 27 Jan 2008 21:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m0RLA3Ui040583 for ; Sun, 27 Jan 2008 21:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m0RLA3cp040582; Sun, 27 Jan 2008 21:10:03 GMT (envelope-from gnats) Resent-Date: Sun, 27 Jan 2008 21:10:03 GMT Resent-Message-Id: <200801272110.m0RLA3cp040582@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ed Schouten Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3169916A417 for ; Sun, 27 Jan 2008 21:03:43 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id CD23713C442 for ; Sun, 27 Jan 2008 21:03:42 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id BCA141CD9D; Sun, 27 Jan 2008 22:03:41 +0100 (CET) Message-Id: <20080127210341.BCA141CD9D@palm.hoeg.nl> Date: Sun, 27 Jan 2008 22:03:41 +0100 (CET) From: Ed Schouten To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/120059: [Patch] korean/hanterm: don't use sgtty X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Schouten List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2008 21:10:03 -0000 >Number: 120059 >Category: ports >Synopsis: [Patch] korean/hanterm: don't use 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: Sun Jan 27 21:10:02 UTC 2008 >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: As one of the last remaining FreeBSD ports, korean/hanterm still uses the sgtty interface, which makes it break on systems that don't have COMPAT_43TTY in the kernel. >How-To-Repeat: >Fix: Apply the following patch to the hanterm port to extend the hanterm port to use termios. I haven't tested the patch, because I was unable to start hanterm, because fonts were missing: hanterm: can't open font "-schumacher-clean-bold-r-normal--16-160-75-75-c-80-*" "-kaist-iyagi-bold-r-normal--16-160-75-75-c-160-johabsh-1" I hope the maintainer of hanterm can do the testing for me. --- korean/hanterm/files/patch-main.c 2002-10-26 03:35:24.000000000 +0200 +++ korean/hanterm/files/patch-main.c 2008-01-27 21:58:54.000000000 +0100 @@ -1,12 +1,91 @@ --- main.c.orig Fri Oct 25 12:00:42 2002 +++ main.c Fri Oct 25 12:01:43 2002 -@@ -224,6 +224,9 @@ - #ifndef linux - #include +@@ -221,8 +221,13 @@ + #define HAS_UTMP_UT_HOST #endif + #else /* SYSV */ +-#ifndef linux +-#include +#ifdef __FreeBSD__ ++#include ++#define USE_TERMIOS ++#define USE_TERMINFO ++#define USE_SYSV_TERMIO ++#define termio termios +#define USE_POSIX_WAIT -+#endif + #endif #include #define HAS_UTMP_UT_HOST - #define HAS_BSD_GROUPS +@@ -1056,11 +1061,13 @@ + #ifdef ECHOCTL + d_tio.c_lflag |= ECHOCTL|IEXTEN; + #endif ++#ifndef __FreeBSD__ + #ifdef NTTYDISC + d_tio.c_line = NTTYDISC; + #else + d_tio.c_line = 0; + #endif ++#endif + #ifdef sgi + d_tio.c_cflag &= ~(HUPCL|PARENB); + d_tio.c_iflag |= BRKINT|ISTRIP|IGNPAR; +@@ -1111,7 +1118,11 @@ + + for (i = 0; i <= 2; i++) { + struct termio deftio; ++#ifdef USE_TERMIOS ++ if (tcgetattr(i, &deftio) == 0) { ++#else + if (ioctl (i, TCGETA, &deftio) == 0) { ++#endif + d_tio.c_cc[VINTR] = deftio.c_cc[VINTR]; + d_tio.c_cc[VQUIT] = deftio.c_cc[VQUIT]; + d_tio.c_cc[VERASE] = deftio.c_cc[VERASE]; +@@ -2021,7 +2032,11 @@ + lmode = d_lmode; + #endif /* TIOCLSET */ + #ifdef USE_SYSV_TERMIO ++#ifdef USE_TERMIOS ++ if(tcgetattr(tty, &tio) == -1) ++#else + if(ioctl(tty, TCGETA, &tio) == -1) ++#endif + tio = d_tio; + + #else /* not USE_SYSV_TERMIO */ +@@ -2389,19 +2404,17 @@ + tio.c_iflag &= ~(INLCR|IGNCR|ISTRIP); + tio.c_iflag |= ICRNL; + /* ouput: cr->cr, nl is not return, no delays, ln->cr/nl */ +- tio.c_oflag &= +- ~(OCRNL|ONLRET|NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY); ++ tio.c_oflag &= ~(OCRNL|ONLRET); + tio.c_oflag |= ONLCR; + #ifdef OPOST + tio.c_oflag |= OPOST; + #endif /* OPOST */ + #ifdef BAUD_0 + /* baud rate is 0 (don't care) */ +- tio.c_cflag &= ~(CBAUD); ++ cfsetspeed(&tio, 0); + #else /* !BAUD_0 */ + /* baud rate is 9600 (nice default) */ +- tio.c_cflag &= ~(CBAUD); +- tio.c_cflag |= B9600; ++ cfsetspeed(&tio, 9600); + #endif /* !BAUD_0 */ + /* dkim@surecom.com */ + tio.c_cflag &= ~CSIZE; +@@ -2512,7 +2525,11 @@ + if (ioctl (tty, TIOCLSET, (char *)&lmode) == -1) + HsSysError(cp_pipe[1], ERROR_TIOCLSET); + #endif /* TIOCLSET */ ++#ifdef USE_TERMIOS ++ if (tcsetattr(tty, TCSANOW, &tio) == -1) ++#else + if (ioctl (tty, TCSETA, &tio) == -1) ++#endif + HsSysError(cp_pipe[1], ERROR_TIOCSETP); + #else /* USE_SYSV_TERMIO */ + sg.sg_flags &= ~(ALLDELAY | XTABS | CBREAK | RAW); >Release-Note: >Audit-Trail: >Unformatted: