From ed@hoeg.nl  Sat Mar 17 11:25:03 2007
Return-Path: <ed@hoeg.nl>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 7B4A016A402
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 17 Mar 2007 11:25:03 +0000 (UTC)
	(envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (palm.hoeg.nl [83.98.131.212])
	by mx1.freebsd.org (Postfix) with ESMTP id 480D313C44C
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 17 Mar 2007 11:25:03 +0000 (UTC)
	(envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 283BE1CD33; Sat, 17 Mar 2007 12:25:02 +0100 (CET)
Message-Id: <20070317112502.283BE1CD33@palm.hoeg.nl>
Date: Sat, 17 Mar 2007 12:25:02 +0100 (CET)
From: Ed Schouten <ed@fxq.nl>
Reply-To: Ed Schouten <ed@fxq.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [cad/spice] Use termios.h
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         110439
>Category:       ports
>Synopsis:       [cad/spice] Use termios.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 17 11:30:00 GMT 2007
>Closed-Date:    Wed Mar 21 12:33:00 GMT 2007
>Last-Modified:  Wed Mar 21 12:40:27 GMT 2007
>Originator:     Ed Schouten
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD palm.hoeg.nl 6.2-STABLE FreeBSD 6.2-STABLE #0: Sun Feb 11 22:32:09 CET 2007 root@palm.hoeg.nl:/usr/obj/usr/src/sys/PALM i386
>Description:
The cad/spice port is one of the ports that uses <sgtty.h> while it
could perfectly use <termios.h>. When we use <termios.h>, compilation
fails, because of some termio leftovers.
>How-To-Repeat:
>Fix:
This patch changes os_bsd.h to use termios on FreeBSD. It also changes
the sourcecode to use tcgetattr/tcsetattr instead of ioctl's.

--- cad/spice/files/patch-src_include_os_bsd_h	Wed Apr  5 22:51:27 2006
+++ cad/spice/files/patch-src_include_os_bsd_h	Sat Mar 17 12:17:58 2007
@@ -1,6 +1,6 @@
 --- src/include/os_bsd.h.orig	Sat Apr 24 18:09:46 1993
 +++ src/include/os_bsd.h	Mon Apr  3 21:27:21 2006
-@@ -8,18 +8,32 @@
+@@ -8,18 +8,36 @@
  
  #include "os_unix.h"
  
@@ -24,8 +24,12 @@
 -#define HAS_INDEX		/* index( ) instead of strchr( )	*/
  #define HAS_BCOPY		/* bcopy( ), bzero( )			*/
  #define HAS_BSDRANDOM		/* srandom( ) and random( )		*/
++#ifdef __FreeBSD__
++#define HAS_POSIXTTY		/* <termios.h>				*/
++#else
  #define HAS_BSDTTY		/* <sgtty.h>				*/
 -#define HAS_BSDDIRS		/* <sys/dir.h>				*/
++#endif
  #define HAS_BSDRUSAGE		/* getrusage( )				*/
  #define HAS_BSDRLIMIT		/* getrlimit( )				*/
  #define HAS_DUP2
--- cad/spice/files/patch-src_lib_cp_complete.c	Thu Jan  1 01:00:00 1970
+++ cad/spice/files/patch-src_lib_cp_complete.c	Sat Mar 17 12:17:58 2007
@@ -0,0 +1,20 @@
+--- src/lib/cp/complete.c	Wed Jun 19 05:55:38 1991
++++ src/lib/cp/complete.c	Sat Mar 17 11:51:56 2007
+@@ -445,14 +445,14 @@
+     ison = on;
+ 
+     if (ison == true) {
+-	(void) ioctl(fileno(cp_in), TERM_GET, (char *) &OS_Buf);
++    	tcgetattr(fileno(cp_in), &OS_Buf);
+ 	sbuf = OS_Buf;
+ 	sbuf.c_cc[VEOF] = 0;
+ 	sbuf.c_cc[VEOL] = ESCAPE;
+ 	sbuf.c_cc[VEOL2] = CNTRL_D;
+-	(void) ioctl(fileno(cp_in), TERM_SET, (char *) &sbuf);
++    	tcsetattr(fileno(cp_in), TCSANOW, &OS_Buf);
+     } else {
+-	(void) ioctl(fileno(cp_in), TERM_SET, (char *) &OS_Buf);
++    	tcsetattr(fileno(cp_in), TCSANOW, &OS_Buf);
+     }
+ 
+ #  endif
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Sun Mar 18 08:46:22 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110439 
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Wed Mar 21 12:32:57 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/110439: commit references a PR
Date: Wed, 21 Mar 2007 12:33:18 +0000 (UTC)

 miwi        2007-03-21 12:32:53 UTC
 
   FreeBSD ports repository
 
   Modified files:
     cad/spice/files      patch-src_include_os_bsd_h 
   Added files:
     cad/spice/files      patch-src_lib_cp_complete.c 
   Log:
   - Use termios.h
   
   PR:             110439
   Submitted by:   Ed Schouten <ed@fxq.nl>
   
   Revision  Changes    Path
   1.3       +5 -1      ports/cad/spice/files/patch-src_include_os_bsd_h
   1.1       +20 -0     ports/cad/spice/files/patch-src_lib_cp_complete.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:
