Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jun 2008 22:49:27 +0200 (CEST)
From:      Ed Schouten <ed@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/124462: [Patch] mail/metamail: fix termios patch
Message-ID:  <20080610204927.0DF951CCAC@palm.hoeg.nl>
Resent-Message-ID: <200806102100.m5AL08DT004208@freefall.freebsd.org>

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

>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@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:



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