opnsense-ports/net/pmf/files/patch-tty.c
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

28 lines
786 B
C

--- ./tty.c.orig 1993-10-29 05:09:06.000000000 -0400
+++ ./tty.c 2010-02-02 14:21:04.000000000 -0500
@@ -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 */