From 48b13ec554322ef79bd13996eca7ab4912dba8ea Mon Sep 17 00:00:00 2001 From: uqs@spoerlein.net Date: Sat, 29 Aug 2009 01:27:34 +0200 Subject: [PATCH 1/2] Replace sgtty by termios This is only required to check the baud rate of the terminal, an FWIW I think there is even a logic error in there, setting the Fast flag, when baud rate is *less* than 1200 ... Anyway, FreeBSD dropped sgtty support, therefore use termios --- games/trek/main.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/games/trek/main.c b/games/trek/main.c index df2a5ae..76f3c40 100644 --- a/games/trek/main.c +++ b/games/trek/main.c @@ -38,7 +38,7 @@ # include "getpar.h" # include "trek.h" -# include +# include # define PRIO 00 /* default priority */ @@ -151,7 +151,7 @@ main(int argc, char **argv) int prio; int ac; char **av; - struct sgttyb argp; + struct termios argp; /* revoke */ setgid(getgid()); @@ -162,9 +162,9 @@ main(int argc, char **argv) srandomdev(); opencode = 'w'; prio = PRIO; - if (ioctl(1, TIOCGETP, &argp) == 0) + if (tcgetattr(1, &argp) == 0) { - if ((argp.sg_ispeed ) < B1200) + if ((cfgetispeed(&argp)) < B1200) Etc.fast++; } while (ac > 1 && av[0][0] == '-') -- 1.6.4