Date: Mon, 26 Mar 2007 20:12:35 +0200 (CEST) From: Ed Schouten <ed@fxq.nl> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/110875: [net/pmf] Use termios.h instead of sgtty.h Message-ID: <20070326181235.252DA1CC79@palm.hoeg.nl> Resent-Message-ID: <200703261820.l2QIK51S015294@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 110875 >Category: ports >Synopsis: [net/pmf] Use termios.h instead of sgtty.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: Mon Mar 26 18:20: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 pmf application makes use of sgtty or termio in a very simple way. It isn't hard to port it to use of termios, making it work on systems that use kernels without COMPAT_43/COMPAT_43TTY. >How-To-Repeat: >Fix: Apply the following patch: --- net/pmf/files/patch-ac Fri Aug 25 16:07:32 2000 +++ net/pmf/files/patch-ac Mon Mar 26 20:07:20 2007 @@ -18,7 +18,7 @@ #define SYSTEM_NEWS_FILE "NEWS" #define SYSTEM_HELP_DIR "helpfiles" #define SYSTEM_SOUND_DIR "soundfiles" -@@ -63,7 +65,9 @@ +@@ -63,14 +65,20 @@ #define X_OUTPUT_PROGRAM "cat" /* What system? Define one either BSD or SYSV:*/ @@ -28,7 +28,8 @@ /* #define SYSV */ /* What ioctl do we use for the ttys? */ -@@ -71,6 +75,10 @@ +-#ifdef BSD ++#if defined(BSD) && !defined(__FreeBSD__) # define USE_TIOCGETP #else # define USE_TCGETA --- net/pmf/files/patch-ad Sun Nov 24 00:50:39 2002 +++ net/pmf/files/patch-ad Mon Mar 26 20:07:20 2007 @@ -1,7 +1,10 @@ --- main.c.orig Sun Sep 22 12:13:43 1991 +++ main.c Fri Feb 11 04:14:00 2000 -@@ -15,6 +15,7 @@ - #include <sgtty.h> +@@ -12,9 +12,9 @@ + #include <stdio.h> + #include <sys/types.h> + #include <sys/stat.h> +-#include <sgtty.h> #include <signal.h> #include <setjmp.h> +#include <sys/param.h> --- net/pmf/files/patch-tty.c Thu Jan 1 01:00:00 1970 +++ net/pmf/files/patch-tty.c Mon Mar 26 20:07:20 2007 @@ -0,0 +1,28 @@ +--- tty.c Fri Oct 29 10:09:06 1993 ++++ tty.c Mon Mar 26 20:02:26 2007 +@@ -18,6 +18,9 @@ + /* Added by dodurham@stimpy.ualr.edu for Linux machines */ + #ifdef SYSV + # include <termio.h> ++#elif defined(__FreeBSD__) ++# include <termios.h> ++# define termio termios + #else + # include <sgtty.h> + #endif +@@ -161,13 +164,13 @@ + + pmf_save_terminal() + { +- if (ioctl(0, TCGETA, &terminal_state) == -1) ++ if (tcgetattr(0, &terminal_state) == -1) + fatal("ioctl TCGETA failed in pmf_save_terminal."); + } /* pmf_save_terminal */ + + pmf_restore_terminal() + { +- if (ioctl(0, TCSETA, &terminal_state) == -1) ++ if (tcsetattr(0, TCSANOW, &terminal_state) == -1) + fatal("ioctl TCSETA failed in pmf_restore_terminal."); + } /* pmf_restore_terminal */ + >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070326181235.252DA1CC79>