From ed@hoeg.nl  Sun Jan 27 16:18:41 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 9255B16A41A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Jan 2008 16:18:41 +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 5C56B13C457
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Jan 2008 16:18:41 +0000 (UTC)
	(envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 14CA31CC44; Sun, 27 Jan 2008 17:18:40 +0100 (CET)
Message-Id: <20080127161840.14CA31CC44@palm.hoeg.nl>
Date: Sun, 27 Jan 2008 17:18:40 +0100 (CET)
From: Ed Schouten <ed@fxq.nl>
Reply-To: Ed Schouten <ed@fxq.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [Patch] cad/magic: don't use sgtty
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         120049
>Category:       ports
>Synopsis:       [Patch] cad/magic: don't use 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 16:20:00 UTC 2008
>Closed-Date:    Mon Feb 04 19:44:12 UTC 2008
>Last-Modified:  Mon Feb  4 19:50: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:
The cad/magic port still includes sgtty.h, while it doesn't use
anything that's in there. We'd better not include sgtty.h, because this
will cause things to break in the future.
>How-To-Repeat:
>Fix:
Just empty magsgtty.h. That header file chooses whether we want sgtty or
termios, but there is no need to include any of them.

--- cad/magic/Makefile	2007-05-19 22:00:34.000000000 +0200
+++ cad/magic/Makefile	2008-01-27 17:11:14.000000000 +0100
@@ -35,6 +35,7 @@
 		 s|include.*<varargs\.h>|include <stdarg\.h>|'
 	@${FIND} ${WRKSRC} -name "Makefile" | ${XARGS} ${REINPLACE_CMD} -e \
 		's|make |\$$\{MAKE\} |g'
+	@${ECHO} > ${WRKSRC}/misc/magsgtty.h
 
 do-configure:
 	@cd ${WRKSRC} && ${WRKSRC}/scripts/makedbh \
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Sun Jan 27 21:21:39 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120049 

From: Ed Schouten <ed@fxq.nl>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Cc:  
Subject: Re: ports/120049: [Patch] cad/magic: don't use sgtty
Date: Mon, 4 Feb 2008 19:35:45 +0100

 --v+Mbu5iuT/5Blw/K
 Content-Type: multipart/mixed; boundary="0UhZIN3Sa23/ILEd"
 Content-Disposition: inline
 
 
 --0UhZIN3Sa23/ILEd
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 It turned out the make scripts of magic lied to me a little; for some
 reason, not all errors are caught during compilation, which made me
 thing I ported magic to termios, which I didn't.
 
 Please use the attached patch. This *really* ports magic to termios.
 
 --=20
  Ed Schouten <ed@fxq.nl>
  WWW: http://g-rave.nl/
 
 --0UhZIN3Sa23/ILEd
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="freebsd-magic.diff"
 Content-Transfer-Encoding: quoted-printable
 
 --- cad/magic/files/patch-misc::magsgtty.h	1970-01-01 01:00:00.000000000 +0=
 100
 +++ cad/magic/files/patch-misc::magsgtty.h	2008-02-04 19:29:11.000000000 +0=
 100
 @@ -0,0 +1,13 @@
 +--- misc/magsgtty.h	2001-09-21 17:15:45.000000000 +0200
 ++++ misc/magsgtty.h	2008-02-04 19:28:46.000000000 +0100
 +@@ -20,7 +20,9 @@
 +=20
 + #ifndef	_MAGSGTTY
 +=20
 +-#if !defined(SYSV) && !defined(CYGWIN)
 ++#ifdef __FreeBSD__
 ++#include <termios.h>
 ++#elif !defined(SYSV) && !defined(CYGWIN)
 + # ifdef	ALPHA
 + # undef MAX
 + # undef MIN
 --- cad/magic/files/patch-textio::textioInt.h	2003-12-09 17:20:31.000000000=
  +0100
 +++ cad/magic/files/patch-textio::textioInt.h	2008-02-04 19:32:48.000000000=
  +0100
 @@ -1,11 +1,16 @@
  --- textio/textioInt.h.orig	Tue Dec  9 16:41:17 2003
  +++ textio/textioInt.h	Tue Dec  9 16:41:29 2003
 -@@ -53,7 +53,7 @@
 +@@ -48,7 +48,7 @@
 + #define TX_LONG_CMD2	';'	/* Alternate way of invoking a long command. */
 +=20
 + /* all of the state associated with a tty terminal */
 +-#if !defined(SYSV) && !defined(CYGWIN)
 ++#if !defined(__FreeBSD__) && !defined(SYSV) && !defined(CYGWIN)
 + typedef struct {
       struct sgttyb tx_i_sgtty;
       struct tchars tx_i_tchars;
 - } txTermState;
 --#endif SYSV
 -+#endif
 +@@ -56,4 +56,4 @@
 + #endif SYSV
  =20
   extern int TxGetInputEvent();
  -extern void txFprintfBasic();
 --- cad/magic/files/patch-textio::txInput.c	1970-01-01 01:00:00.000000000 +=
 0100
 +++ cad/magic/files/patch-textio::txInput.c	2008-02-04 19:27:16.000000000 +=
 0100
 @@ -0,0 +1,96 @@
 +--- textio/txInput.c	2001-09-21 17:15:56.000000000 +0200
 ++++ textio/txInput.c	2008-02-04 19:26:44.000000000 +0100
 +@@ -1027,7 +1027,16 @@
 +  * ----------------------------------------------------------------------=
 ------
 +  */
 +=20
 +-#if defined(SYSV) || defined(CYGWIN)
 ++#ifdef __FreeBSD__
 ++void
 ++txGetTermState(buf)
 ++    struct termios *buf;
 ++
 ++{
 ++    tcgetattr( fileno( stdin ), buf);
 ++}
 ++
 ++#elif defined(SYSV) || defined(CYGWIN)
 + void
 + txGetTermState(buf)
 +     struct termio *buf;
 +@@ -1066,13 +1075,17 @@
 +=20
 + void
 + txSetTermState(buf)
 +-#if defined(SYSV) || defined(CYGWIN)
 ++#ifdef __FreeBSD__
 ++    struct termios *buf;
 ++#elif defined(SYSV) || defined(CYGWIN)
 +     struct termio *buf;
 + #else
 +     txTermState *buf;
 + #endif SYSV
 + {
 +-#if defined(SYSV) || defined(CYGWIN)
 ++#ifdef __FreeBSD__
 ++    tcsetattr( fileno(stdin), TCSAFLUSH, buf );
 ++#elif defined(SYSV) || defined(CYGWIN)
 +     ioctl( fileno(stdin), TCSETAF, buf );
 + #else
 +     /* set the current terminal characteristics */
 +@@ -1100,13 +1113,15 @@
 +=20
 + void
 + txInitTermRec(buf)
 +-#if defined(SYSV) || defined(CYGWIN)
 ++#ifdef __FreeBSD__
 ++    struct termios *buf;
 ++#elif defined(SYSV) || defined(CYGWIN)
 +     struct termio *buf;
 + #else
 +     txTermState *buf;
 + #endif SYSV
 + {
 +-#if defined(SYSV) || defined(CYGWIN)
 ++#if defined(__FreeBSD__) || defined(SYSV) || defined(CYGWIN)
 +     buf->c_lflag =3D ISIG;    /* raw: no echo and no processing, allow si=
 gnals */
 +     buf->c_cc[ VMIN ] =3D 1;
 +     buf->c_cc[ VTIME ] =3D 0;
 +@@ -1124,7 +1139,9 @@
 +=20
 + =0C
 +=20
 +-#if defined(SYSV) || defined(CYGWIN)
 ++#ifdef __FreeBSD__
 ++struct termios closeTermState;
 ++#elif defined(SYSV) || defined(CYGWIN)
 + struct termio closeTermState;
 + #else
 + static txTermState closeTermState;
 +@@ -1151,7 +1168,14 @@
 + void
 + txSaveTerm()
 + {
 +-#if defined(SYSV) || defined(CYGWIN)
 ++#ifdef __FreeBSD__
 ++    tcgetattr( fileno( stdin ), &closeTermState);
 ++    txEraseChar =3D closeTermState.c_cc[VERASE];
 ++    txKillChar =3D  closeTermState.c_cc[VKILL];
 ++    TxEOFChar =3D closeTermState.c_cc[VEOF];
 ++    TxInterruptChar =3D closeTermState.c_cc[VINTR];
 ++    haveCloseState =3D TRUE;
 ++#elif defined(SYSV) || defined(CYGWIN)
 +     ioctl( fileno( stdin ), TCGETA, &closeTermState);
 +     txEraseChar =3D closeTermState.c_cc[VERASE];
 +     txKillChar =3D  closeTermState.c_cc[VKILL];
 +@@ -1192,7 +1216,9 @@
 + void
 + TxSetTerminal()
 + {
 +-#if defined(SYSV) || defined(CYGWIN)
 ++#ifdef __FreeBSD__
 ++    struct termios buf;
 ++#elif defined(SYSV) || defined(CYGWIN)
 +     struct termio buf;
 + #else
 +     txTermState buf;
 
 --0UhZIN3Sa23/ILEd--
 
 --v+Mbu5iuT/5Blw/K
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (FreeBSD)
 
 iEYEARECAAYFAkenWwEACgkQ52SDGA2eCwW4NwCfWCatewniUnMp18a4FrClV0f7
 /9wAn1XL8vajS8Z+0ZSWSC4FCEYlASJJ
 =vTri
 -----END PGP SIGNATURE-----
 
 --v+Mbu5iuT/5Blw/K--
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Mon Feb 4 19:44:11 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120049 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/120049: commit references a PR
Date: Mon,  4 Feb 2008 19:43:59 +0000 (UTC)

 miwi        2008-02-04 19:43:52 UTC
 
   FreeBSD ports repository
 
   Modified files:
     cad/magic/files      patch-textio::textioInt.h 
   Added files:
     cad/magic/files      patch-misc::magsgtty.h 
                          patch-textio::txInput.c 
   Log:
   Use termios.h instead of sgtty.h
   
   PR:             120049
   Submitted by:   Ed Schouten <ed@fxq.nl>
   
   Revision  Changes    Path
   1.1       +13 -0     ports/cad/magic/files/patch-misc::magsgtty.h (new)
   1.2       +9 -4      ports/cad/magic/files/patch-textio::textioInt.h
   1.1       +96 -0     ports/cad/magic/files/patch-textio::txInput.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
