Bug 124462 - [Patch] mail/metamail: fix termios patch
Summary: [Patch] mail/metamail: fix termios patch
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ed Schouten
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-10 22:00 UTC by Ed Schouten
Modified: 2008-06-19 09:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Schouten freebsd_committer freebsd_triage 2008-06-10 22:00:08 UTC
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.

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() {
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-06-10 22:00:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ed

Submitter has GNATS access (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2008-06-10 22:00:15 UTC
Maintainer of mail/metamail,

Please note that PR ports/124462 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124462

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2008-06-10 22:00:16 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Jean-Francois Dockes 2008-06-11 12:10:35 UTC
Sorry, the change seems reasonable enough but the patch seems 
garbled and won't apply (bad copy / paste ?)

Edwin Groothuis writes:
 > 
 > Maintainer of mail/metamail,
 > 
 > Please note that PR ports/124462 has just been submitted.
 > 
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 > 
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124462
 > 
 > -- 
 > Edwin Groothuis via the GNATS Auto Assign Tool
 > edwin@FreeBSD.org
Comment 5 Jean-Francois Dockes 2008-06-11 17:31:24 UTC
The patch does apply when obtained through the raw pr page. Approved.

jf

Jean-Francois Dockes writes:
 > 
 > Sorry, the change seems reasonable enough but the patch seems 
 > garbled and won't apply (bad copy / paste ?)
Comment 6 Pav Lucistnik freebsd_committer freebsd_triage 2008-06-18 20:38:13 UTC
State Changed
From-To: feedback->open

Approved by maintainer
Comment 7 dfilter service freebsd_committer freebsd_triage 2008-06-19 09:43:43 UTC
ed          2008-06-19 08:43:39 UTC

  FreeBSD ports repository (src committer)

  Modified files:
    mail/metamail        Makefile 
    mail/metamail/files  patch-metamail_metamail.c 
  Log:
  Make metamail compile after the sgtty removal.
  
  The metamail port was patched to use termios a long time ago.
  Unforunately, the patch left some calls to stty() and gtty(). Change
  these calls to tcgetattr() and tcsetattr().
  
  PR:             124462
  Approved by:    philip (mentor)
  
  Revision  Changes    Path
  1.33      +1 -1      ports/mail/metamail/Makefile
  1.4       +27 -0     ports/mail/metamail/files/patch-metamail_metamail.c
_______________________________________________
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"
Comment 8 Ed Schouten freebsd_committer freebsd_triage 2008-06-19 09:43:59 UTC
State Changed
From-To: open->closed

Committed. Thanks!