Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Mar 2007 11:32:03 +0100 (CET)
From:      Ed Schouten <ed@fxq.nl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/110435: [mail/metamail] Use <termios.h>
Message-ID:  <20070317103203.185941CD33@palm.hoeg.nl>
Resent-Message-ID: <200703171040.l2HAe5Tq024251@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         110435
>Category:       ports
>Synopsis:       [mail/metamail] Use <termios.h>
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 17 10:40:04 GMT 2007
>Closed-Date:
>Last-Modified:
>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 Metamail MIME implementation uses <sgtty.h> or <termio.h>. It isn't
hard to port this application to use <termios.h>, causing it to work
properly without COMPAT_43TTY.
>How-To-Repeat:
>Fix:
This patch patches a patch (wow) to force usage of <termios.h>.

--- mail/metamail/files/patch-metamail_metamail.c	Tue Dec 19 02:48:53 2006
+++ mail/metamail/files/patch-metamail_metamail.c	Sat Mar 17 11:28:18 2007
@@ -9,6 +9,17 @@
  #include <ctype.h>
  #include <sys/types.h>
  #include <sys/stat.h>
+@@ -46,8 +48,8 @@
+ #include <signal.h>
+ 
+ #ifndef AMIGA
+-#ifdef SYSV
+-#include <termio.h>
++#if 1
++#include <termios.h>
+ #include <unistd.h>
+ #else /* SYSV */
+ #include <sgtty.h>
 @@ -83,7 +85,7 @@
  #define MAX_FILE_NAME_SIZE 256
  #define WRITE_BINARY	"w"
@@ -116,3 +127,34 @@
      } else {
          /* What follows is REALLY bogus, but all my encoding stuff is pipe-oriented right now... */
          MkTmpFileName(TmpFile);
+@@ -2375,8 +2387,8 @@
+ 
+ int HasSavedTtyState=0;
+ #if !defined(AMIGA) && !defined(MSDOS)
+-#ifdef SYSV
+-static struct termio MyTtyStateIn, MyTtyStateOut;
++#if 1
++static struct termios MyTtyStateIn, MyTtyStateOut;
+ #else
+ static struct sgttyb MyTtyStateIn, MyTtyStateOut;
+ #endif
+@@ -2681,15 +2693,15 @@
+ 
+ StartRawStdin() {
+ #if !defined(AMIGA) && !defined(MSDOS)
+-#ifdef SYSV
+-    struct termio   orterm, fterm;
+-    ioctl(0, TCGETA, &orterm);	/* get current (i.e. cooked) termio */
++#if 1
++    struct termios   orterm, fterm;
++    tcgetattr(0, &orterm);
+     fterm = orterm;		/* get termio to modify */
+ 
+     fterm.c_lflag &= ~ICANON;	/* clear ICANON giving raw mode */
+     fterm.c_cc[VMIN] = 1;	/* set MIN char count to 1 */
+     fterm.c_cc[VTIME] = 0;	/* set NO time limit */
+-    return ioctl(0, TCSETAW, &fterm);	/* modify termio for raw mode */
++    return tcsetattr(0, TCSANOW, &fterm);	/* modify termio for raw mode */
+ #else
+     struct sgttyb ts;
+     gtty(fileno(stdin), &ts);
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070317103203.185941CD33>