From ea8b5cb7c8ebe361adebefbe8134e1fd1888383b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 24 Jan 2005 16:02:57 +0000 Subject: [PATCH] Get rid of BSD tty support. --- morse.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/morse.c b/morse.c index 1437a37..73e3a78 100644 --- a/morse.c +++ b/morse.c @@ -133,8 +133,6 @@ char copyleftjoe[] = #include #include "beep.h" -#define USG - #define FREQUENCY 800.0 #define FREQUENCY2 602.0 #define VOLUME 0.5 @@ -1824,29 +1822,19 @@ toneflush (void) #include #include -#ifdef USG #include struct termio oldtermgtty; struct termio termgtty; -#else -#include -struct sgttyb oldtermgtty; -struct sgttyb termgtty; -#endif static char *terminal = "/dev/tty"; static int termfd; static int termopen = 0; - -#ifndef USG static int oldflgs, newflgs; -#endif static void openterminal (void) { /* get parameters and open terminal */ -#ifdef USG termfd = open (terminal, O_RDWR | O_NDELAY, 0); ioctl (termfd, TCGETA, &termgtty); oldtermgtty = termgtty; @@ -1856,18 +1844,6 @@ openterminal (void) termgtty.c_cc[VMIN] = 1; termgtty.c_cc[VTIME] = 0; ioctl (termfd, TCSETAW, &termgtty); -#else - termfd = open (terminal, O_RDWR, 0); - ioctl (termfd, TIOCGETP, &termgtty); - oldtermgtty = termgtty; - if (typeaway != LETMESEE) - termgtty.sg_flags &= ~ECHO; - termgtty.sg_flags |= CBREAK; - ioctl (termfd, TIOCSETP, &termgtty); - oldflgs = fcntl (termfd, F_GETFL); - newflgs = oldflgs | FNDELAY; -#endif - termopen = 1; } @@ -1878,13 +1854,7 @@ readterminal (char **string) static char line[TESTBUFSZ]; int n; -#ifndef USG - fcntl (termfd, F_SETFL, newflgs); -#endif n = read (termfd, line, sizeof (line) - 1); -#ifndef USG - fcntl (termfd, F_SETFL, oldflgs); -#endif if (n > 0) { @@ -1900,11 +1870,7 @@ int n; static void closeterminal (void) { -#ifdef USG ioctl (termfd, TCSETAW, &oldtermgtty); -#else - ioctl (termfd, TIOCSETP, &oldtermgtty); -#endif close (termfd); } -- 2.43.0