From ed@hoeg.nl  Sun Jan 27 21:38:43 2008
Return-Path: <ed@hoeg.nl>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7DB0016A41A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Jan 2008 21:38: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 488B213C448
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Jan 2008 21:38:43 +0000 (UTC)
	(envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 79E9D1CD9D; Sun, 27 Jan 2008 22:38:42 +0100 (CET)
Message-Id: <20080127213842.79E9D1CD9D@palm.hoeg.nl>
Date: Sun, 27 Jan 2008 22:38:42 +0100 (CET)
From: Ed Schouten <ed@fxq.nl>
Reply-To: Ed Schouten <ed@fxq.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [Patch] chinese/hztty: migrate to termios, not sgtty
X-Send-Pr-Version: 3.113
X-GNATS-Notify: ada@bsd.org

>Number:         120062
>Category:       ports
>Synopsis:       [Patch] chinese/hztty: migrate to termios, not sgtty
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 27 21:40:03 UTC 2008
>Closed-Date:    Sun Jan 27 23:48:02 UTC 2008
>Last-Modified:  Sun Jan 27 23:48:02 UTC 2008
>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:
hztty is one of the last applications in ports that still uses sgtty,
while it could perfectly use termios, making the application work on
systems that don't have COMPAT_43TTY defined in the kernel. We'd better
migrate it.
>How-To-Repeat:
>Fix:
The following patch adjusts two existing patchfiles to change the
application to use termios.

--- chinese/hztty/files/patch-aa	2000-04-02 06:50:09.000000000 +0200
+++ chinese/hztty/files/patch-aa	2008-01-27 22:35:58.000000000 +0100
@@ -17,12 +17,14 @@
  
  PROG = hztty
  LIBS=
-@@ -132,7 +131,7 @@
+@@ -132,8 +131,8 @@
  
  
  bsd:
 -	miniconf.sh $(CPP)
+-	${MAKE} ${MFLAGS} DEFINES='-DBSD' ${PROG}
 +	./miniconf.sh $(CPP)
- 	${MAKE} ${MFLAGS} DEFINES='-DBSD' ${PROG}
++	${MAKE} ${MFLAGS} DEFINES='-DPOSIX' ${PROG}
  
  posix:
+ 	miniconf.sh $(CPP)
--- chinese/hztty/files/patch-ab	1997-10-07 09:03:41.000000000 +0200
+++ chinese/hztty/files/patch-ab	2008-01-27 22:35:58.000000000 +0100
@@ -9,3 +9,25 @@
  # define	PTYDEV		"/dev/ptyxx"
  # define	TTYDEV		"/dev/ttyxx"
  #endif  /* !hpux */
+@@ -320,7 +320,9 @@
+ #ifdef	  TIOCLSET
+ 	(void) ioctl (tty, TIOCLGET, (char *)&(termptr->lmode));
+ #endif
+-#ifdef	USE_SYSV_TERMIO
++#ifdef USE_TERMIOS
++	tcgetattr(tty,               (char *)&(termptr->tio));
++#elif defined(USE_SYSV_TERMIO)
+ 	(void) ioctl (tty, TCGETA,   (char *)&(termptr->tio));
+ #else	/* USE_SYSV_TERMIO */
+ 	(void) ioctl (tty, TIOCGETP, (char *)&(termptr->sb));
+@@ -339,7 +341,9 @@
+ #ifdef	  TIOCLSET
+ 	(void) ioctl (tty, TIOCLSET, (char *)&(termptr->lmode));
+ #endif
+-#ifdef	USE_SYSV_TERMIO
++#ifdef USE_TERMIOS
++	tcsetattr(tty, TCSANOW,      (char *)&(termptr->tio));
++#elif defined(USE_SYSV_TERMIO)
+ 	(void) ioctl (tty, TCSETA,   (char *)&(termptr->tio));
+ #else	/* USE_SYSV_TERMIO */
+ 	(void) ioctl (tty, TIOCSETP, (char *)&(termptr->sb));
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sun Jan 27 21:40:08 UTC 2008 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120062 
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Sun Jan 27 22:28:43 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120062 
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Sun Jan 27 23:48:01 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120062 
>Unformatted:
