- Use termios.h instead of sgtty.h

PR:             110875
Submitted by:   Ed Schouten <ed@fxq.nl>
This commit is contained in:
Martin Wilke 2007-03-27 07:38:14 +00:00
parent 51ed7e3328
commit 9753d885d2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=188464
3 changed files with 36 additions and 4 deletions

View File

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

View File

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

28
net/pmf/files/patch-tty.c Normal file
View File

@ -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 */