diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2013-09-19 16:12:02 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2013-09-19 16:12:02 +0000 |
commit | 9dcae335db31b109f2eeb4b6b63e0cab3328de65 (patch) | |
tree | b6bc771672ba0ddcf2316468407b77b264968c11 /usr.bin/bc/scan.l | |
parent | 6f3beff0ed61c4dd99f705958a5ae95ea659e832 (diff) |
separate termios.h out from scan.l, both have an ECHO define. Noted by
Joris Giovannangeli.
Diffstat (limited to 'usr.bin/bc/scan.l')
-rw-r--r-- | usr.bin/bc/scan.l | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/usr.bin/bc/scan.l b/usr.bin/bc/scan.l index a49ef2cb38c..8372f540f60 100644 --- a/usr.bin/bc/scan.l +++ b/usr.bin/bc/scan.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: scan.l,v 1.27 2011/08/03 08:48:19 otto Exp $ */ +/* $OpenBSD: scan.l,v 1.28 2013/09/19 16:12:01 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> @@ -20,9 +20,7 @@ #include <err.h> #include <histedit.h> #include <signal.h> -#include <stdbool.h> #include <string.h> -#include <termios.h> #include <unistd.h> #include "extern.h" @@ -41,7 +39,6 @@ static size_t strbuf_sz = 1; static bool dot_seen; static int use_el; static volatile sig_atomic_t skipchars; -struct termios ttysaved, ttyedit; static void init_strbuf(void); static void add_str(const char *); @@ -255,45 +252,6 @@ abort_line(int sig) errno = save_errno; } -int -settty(struct termios *t) -{ - int ret; - - while ((ret = tcsetattr(0, TCSADRAIN, t) == -1) && errno == EINTR) - continue; - return ret; -} - -int -gettty(struct termios *t) -{ - int ret; - - while ((ret = tcgetattr(0, t) == -1) && errno == EINTR) - continue; - return ret; -} - -/* ARGSUSED */ -void -tstpcont(int sig) -{ - int save_errno = errno; - - if (sig == SIGTSTP) { - signal(SIGCONT, tstpcont); - gettty(&ttyedit); - settty(&ttysaved); - } else { - signal(SIGTSTP, tstpcont); - settty(&ttyedit); - } - signal(sig, SIG_DFL); - kill(0, sig); - errno = save_errno; -} - /* * Avoid the echo of ^D by the default code of editline and take * into account skipchars to make ^D work when the cursor is at start of |