1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-21 04:06:46 +00:00
freebsd-ports/net/pmf/files/patch-tty.c
Martin Wilke 9753d885d2 - Use termios.h instead of sgtty.h
PR:             110875
Submitted by:   Ed Schouten <ed@fxq.nl>
2007-03-27 07:38:14 +00:00

29 lines
755 B
C

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