diff options
author | glewis <glewis@FreeBSD.org> | 2008-06-19 14:39:27 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2008-06-19 14:39:27 +0800 |
commit | a36d519ef605c300b4c71abbb016b1ae35b5271b (patch) | |
tree | 170d945fc9ae739529dba059ab5e79f79c0f150f /games | |
parent | 1691b1d9ac503bbc546dac03de49183964155307 (diff) | |
download | freebsd-ports-gnome-a36d519ef605c300b4c71abbb016b1ae35b5271b.tar.gz freebsd-ports-gnome-a36d519ef605c300b4c71abbb016b1ae35b5271b.tar.zst freebsd-ports-gnome-a36d519ef605c300b4c71abbb016b1ae35b5271b.zip |
. Switch to termios now that sgtty has become a binary only compatibility
layer. This is done for all versions of FreeBSD, not just recent
8-CURRENT (which is where the sgtty change was made) to avoid more ugly
#ifdef's throughout this code (which is already littered with them).
This change was only tested on FreeBSD 6, but I believe it will fix the
build for 8-CURRENT.
Prompted by: pointyhat (via pav)
Diffstat (limited to 'games')
-rw-r--r-- | games/moria/files/patch-source::io.c | 128 |
1 files changed, 121 insertions, 7 deletions
diff --git a/games/moria/files/patch-source::io.c b/games/moria/files/patch-source::io.c index ee9cb30c4f30..8bec0d1170d6 100644 --- a/games/moria/files/patch-source::io.c +++ b/games/moria/files/patch-source::io.c @@ -1,19 +1,28 @@ $FreeBSD$ ---- source/io.c.orig Thu Jul 21 19:47:26 1994 -+++ source/io.c Fri Aug 15 07:42:02 2003 +--- source/io.c.orig 1994-07-21 18:47:26.000000000 -0700 ++++ source/io.c 2008-06-18 23:29:02.000000000 -0700 @@ -13,6 +13,11 @@ #include "config.h" +#ifdef __FreeBSD__ -+#include <sys/ioctl_compat.h> -+#include <time.h> ++#include <termios.h> ++#define USG +#endif + #ifdef HPUX #include <sys/bsdtty.h> #endif +@@ -201,7 +206,7 @@ + #if !defined(MAC) && !defined(MSDOS) && !defined(ATARI_ST) && !defined(VMS) + #ifndef AMIGA + #ifdef USG +-#ifdef __linux__ ++#if defined(__linux__) || defined(__FreeBSD__) + static struct termios save_termio; + #else + static struct termio save_termio; @@ -245,7 +250,9 @@ struct ltchars lcbuf; struct tchars cbuf; @@ -24,7 +33,17 @@ $FreeBSD$ py.misc.male |= 2; (void) ioctl(0, TIOCGETP, (char *)&tbuf); -@@ -313,7 +320,7 @@ +@@ -306,14 +313,16 @@ + #endif + #else + #if !defined(VMS) && !defined(MSDOS) && !defined(ATARI_ST) +-#ifndef AMIGA ++#if !defined(AMIGA) && !defined(__FreeBSD__) + (void) ioctl(0, TCGETA, (char *)&save_termio); ++#else ++ (void) tcgetattr(0, &save_termio); + #endif + #endif #endif /* PC curses returns ERR */ @@ -33,7 +52,7 @@ $FreeBSD$ if (initscr() == NULL) #else if (initscr() == ERR) -@@ -331,7 +338,7 @@ +@@ -331,7 +340,7 @@ #if defined(atarist) && defined(__GNUC__) (void) signal (SIGTSTP, (__Sigfunc)suspend); #else @@ -42,7 +61,89 @@ $FreeBSD$ (void) signal (SIGTSTP, (sig_t)suspend); #else (void) signal (SIGTSTP, suspend); -@@ -757,7 +764,7 @@ +@@ -385,7 +394,7 @@ + #if !defined(MSDOS) && !defined(ATARI_ST) && !defined(VMS) + #ifndef AMIGA + #ifdef USG +-#ifdef __linux__ ++#if defined(__linux__) || defined(__FreeBSD__) + struct termios tbuf; + #else + struct termio tbuf; +@@ -420,7 +429,11 @@ + #else + #if !defined(ATARI_ST) && !defined(VMS) + #ifdef USG ++#ifdef __FreeBSD__ ++ (void) tcgetattr(0, &tbuf); ++#else + (void) ioctl(0, TCGETA, (char *)&tbuf); ++#endif + /* disable all of the normal special control characters */ + tbuf.c_cc[VINTR] = (char)3; /* control-C */ + tbuf.c_cc[VQUIT] = (char)-1; +@@ -438,7 +451,11 @@ + tbuf.c_cc[VMIN] = 1; /* Input should wait for at least 1 char */ + tbuf.c_cc[VTIME] = 0; /* no matter how long that takes. */ + ++#ifdef __FreeBSD__ ++ (void) tcsetattr(0, TCSANOW, &tbuf); ++#else + (void) ioctl(0, TCSETA, (char *)&tbuf); ++#endif + #else + /* disable all of the special characters except the suspend char, interrupt + char, and the control flow start/stop characters */ +@@ -552,9 +569,13 @@ + #ifdef USG + #if !defined(MSDOS) && !defined(ATARI_ST) && !defined(VMS) + #ifndef AMIGA ++#ifdef __FreeBSD__ ++ (void) tcsetattr(0, TCSANOW, &save_termio); ++#else + (void) ioctl(0, TCSETA, (char *)&save_termio); + #endif + #endif ++#endif + #else + (void) ioctl(0, TIOCSLTC, (char *)&save_special_chars); + (void) ioctl(0, TIOCSETP, (char *)&save_ttyb); +@@ -646,7 +667,7 @@ + { + #ifdef USG + #if !defined(MSDOS) && !defined(ATARI_ST) && !defined(AMIGA) +-#ifdef __linux__ ++#if defined(__linux__) || defined(__FreeBSD__) + struct termios tbuf; + #else + struct termio tbuf; +@@ -683,8 +704,12 @@ + + #ifdef USG + #if !defined(MSDOS) && !defined(ATARI_ST) && !defined(AMIGA) ++#ifdef __FreeBSD__ ++ (void) tcgetattr(0, &tbuf); ++#else + (void) ioctl(0, TCGETA, (char *)&tbuf); + #endif ++#endif + #else + (void) ioctl(0, TIOCGETP, (char *)&tbuf); + (void) ioctl(0, TIOCGETC, (char *)&cbuf); +@@ -725,8 +750,12 @@ + default_signals(); + #ifdef USG + #if !defined(MSDOS) && !defined(ATARI_ST) && !defined(AMIGA) ++#ifdef __FreeBSD__ ++ (void) tcsetattr(0, TCSANOW, &save_termio); ++#else + (void) ioctl(0, TCSETA, (char *)&save_termio); + #endif ++#endif + #else + (void) ioctl(0, TIOCSLTC, (char *)&save_special_chars); + (void) ioctl(0, TIOCSETP, (char *)&save_ttyb); +@@ -757,7 +786,7 @@ msg_print("Fork failed. Try again."); return; } @@ -51,3 +152,16 @@ $FreeBSD$ (void) wait((int *) 0); #else (void) wait((union wait *) 0); +@@ -785,8 +814,12 @@ + /* have to disable ^Y for tunneling */ + #ifdef USG + #if !defined(MSDOS) && !defined(ATARI_ST) ++#ifdef __FreeBSD__ ++ (void) tcsetattr(0, TCSANOW, &tbuf); ++#else + (void) ioctl(0, TCSETA, (char *)&tbuf); + #endif ++#endif + #else + (void) ioctl(0, TIOCSLTC, (char *)&lcbuf); + (void) ioctl(0, TIOCSETP, (char *)&tbuf); |