ports/124462: [Patch] mail/metamail: fix termios patch

Ed Schouten ed at FreeBSD.org
Tue Jun 10 21:00:08 UTC 2008


>Number:         124462
>Category:       ports
>Synopsis:       [Patch] mail/metamail: fix termios patch
>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:   Tue Jun 10 21:00:08 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Ed Schouten
>Release:        FreeBSD 6.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD palm.hoeg.nl 6.3-STABLE FreeBSD 6.3-STABLE #0: Wed Jun 4 08:56:01 CEST 2008 ed at palm.hoeg.nl:/usr/obj/usr/src/sys/PALM i386
>Description:
The mail/metamail port has been patched some time ago to use termios,
not sgtty. Unfortunately the patch missed two chunks, which means it
still called stty() and gtty(), even though it should have used
tcsetattr() and tcgetattr() there.
>How-To-Repeat:
>Fix:
--- mail/metamail/files/patch-metamail_metamail.c
+++ mail/metamail/files/patch-metamail_metamail.c
@@ -138,6 +138,33 @@
  #else
  static struct sgttyb MyTtyStateIn, MyTtyStateOut;
  #endif
+@@ -2385,9 +2397,9 @@
+ SaveTtyState() {
+     /* Bogus -- would like a good portable way to reset the terminal state here */
+ #if !defined(AMIGA) && !defined(MSDOS)
+-#ifdef SYSV
+-    ioctl(fileno(stdin), TCGETA, &MyTtyStateIn);
+-    ioctl(fileno(stdout), TCGETA, &MyTtyStateOut);
++#if 1
++    tcgetattr(fileno(stdin), &MyTtyStateIn);
++    tcgetattr(fileno(stdout), &MyTtyStateOut);
+ #else
+     gtty(fileno(stdin), &MyTtyStateIn);
+     gtty(fileno(stdout), &MyTtyStateOut);
+@@ -2398,10 +2410,10 @@
+ 
+ RestoreTtyState() {
+ #if !defined(AMIGA) && !defined(MSDOS)
+-#ifdef SYSV
++#if 1
+     if (HasSavedTtyState) {
+-        ioctl(fileno(stdout), TCSETA, &MyTtyStateOut);
+-        ioctl(fileno(stdin), TCSETA, &MyTtyStateIn);
++        tcsetattr(fileno(stdout), TCSANOW, &MyTtyStateOut);
++        tcsetattr(fileno(stdin), TCSANOW, &MyTtyStateIn);
+     }
+ #else
+     if (HasSavedTtyState) {
 @@ -2681,15 +2693,15 @@
  
  StartRawStdin() {
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list