summaryrefslogtreecommitdiffstats
path: root/bin/stty
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-04-30 17:04:26 +0000
committerache <ache@FreeBSD.org>2000-04-30 17:04:26 +0000
commit9e83ee311bb66d63ab25c123779e61ad1f1cd5cf (patch)
tree305e8fe881e5c9e0897ab997e1a47432486ce0d1 /bin/stty
parentaa662159af43f8cb75ca80df5e1d2d4653eafa64 (diff)
downloadFreeBSD-src-9e83ee311bb66d63ab25c123779e61ad1f1cd5cf.zip
FreeBSD-src-9e83ee311bb66d63ab25c123779e61ad1f1cd5cf.tar.gz
Back out all drainwait changes. It is enough controllable via sysctl or
comcontrol, having it in stty cause too many problems with existing drivers and tty access permissings of non-superuser. Asked-by: bde
Diffstat (limited to 'bin/stty')
-rw-r--r--bin/stty/extern.h6
-rw-r--r--bin/stty/gfmt.c28
-rw-r--r--bin/stty/key.c15
-rw-r--r--bin/stty/print.c6
-rw-r--r--bin/stty/stty.12
-rw-r--r--bin/stty/stty.c13
-rw-r--r--bin/stty/stty.h2
7 files changed, 17 insertions, 55 deletions
diff --git a/bin/stty/extern.h b/bin/stty/extern.h
index 5c25b33..27869f8 100644
--- a/bin/stty/extern.h
+++ b/bin/stty/extern.h
@@ -38,12 +38,12 @@ int c_cchars __P((const void *, const void *));
int c_modes __P((const void *, const void *));
int csearch __P((char ***, struct info *));
void checkredirect __P((void));
-void gprint __P((struct termios *, struct winsize *, int, int));
-void gread __P((struct info *, char *));
+void gprint __P((struct termios *, struct winsize *, int));
+void gread __P((struct termios *, char *));
int ksearch __P((char ***, struct info *));
int msearch __P((char ***, struct info *));
void optlist __P((void));
-void print __P((struct termios *, struct winsize *, int, int, enum FMT));
+void print __P((struct termios *, struct winsize *, int, enum FMT));
void usage __P((void));
extern struct cchar cchars1[], cchars2[];
diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c
index b408792..b34a117 100644
--- a/bin/stty/gfmt.c
+++ b/bin/stty/gfmt.c
@@ -59,11 +59,10 @@ gerr(s)
}
void
-gprint(tp, wp, ldisc, timeout)
+gprint(tp, wp, ldisc)
struct termios *tp;
struct winsize *wp;
int ldisc;
- int timeout;
{
struct cchar *cp;
@@ -72,21 +71,19 @@ gprint(tp, wp, ldisc, timeout)
(u_long)tp->c_oflag);
for (cp = cchars1; cp->name; ++cp)
(void)printf("%s=%x:", cp->name, tp->c_cc[cp->sub]);
- (void)printf("ispeed=%lu:ospeed=%lu:drainwait=%d\n",
- (u_long)cfgetispeed(tp), (u_long)cfgetospeed(tp), timeout);
+ (void)printf("ispeed=%lu:ospeed=%lu\n",
+ (u_long)cfgetispeed(tp), (u_long)cfgetospeed(tp));
}
void
-gread(i, s)
- struct info *i;
+gread(tp, s)
+ struct termios *tp;
char *s;
{
struct cchar *cp;
- struct termios *tp;
char *ep, *p;
long tmp;
- tp = &(i->t);
if ((s = strchr(s, ':')) == NULL)
gerr(NULL);
for (++s; s != NULL;) {
@@ -101,42 +98,28 @@ gread(i, s)
#define CHK(s) (*p == s[0] && !strcmp(p, s))
if (CHK("cflag")) {
tp->c_cflag = tmp;
- i->set = 1;
continue;
}
if (CHK("iflag")) {
tp->c_iflag = tmp;
- i->set = 1;
continue;
}
if (CHK("ispeed")) {
(void)sscanf(ep, "%ld", &tmp);
tp->c_ispeed = tmp;
- i->set = 1;
continue;
}
if (CHK("lflag")) {
tp->c_lflag = tmp;
- i->set = 1;
continue;
}
if (CHK("oflag")) {
tp->c_oflag = tmp;
- i->set = 1;
continue;
}
if (CHK("ospeed")) {
(void)sscanf(ep, "%ld", &tmp);
tp->c_ospeed = tmp;
- i->set = 1;
- continue;
- }
- if (CHK("drainwait")) {
- (void)sscanf(ep, "%ld", &tmp);
- if (i->timeout != tmp) {
- i->timeout = tmp;
- i->tset = 1;
- }
continue;
}
for (cp = cchars1; cp->name != NULL; ++cp)
@@ -144,7 +127,6 @@ gread(i, s)
if (cp->sub == VMIN || cp->sub == VTIME)
(void)sscanf(ep, "%ld", &tmp);
tp->c_cc[cp->sub] = tmp;
- i->set = 1;
break;
}
if (cp->name == NULL)
diff --git a/bin/stty/key.c b/bin/stty/key.c
index 9aed9a1..ba33a81 100644
--- a/bin/stty/key.c
+++ b/bin/stty/key.c
@@ -56,7 +56,6 @@ void f_all __P((struct info *));
void f_cbreak __P((struct info *));
void f_columns __P((struct info *));
void f_dec __P((struct info *));
-void f_drainwait __P((struct info *));
void f_everything __P((struct info *));
void f_extproc __P((struct info *));
void f_ispeed __P((struct info *));
@@ -83,7 +82,6 @@ static struct key {
{ "columns", f_columns, F_NEEDARG },
{ "cooked", f_sane, 0 },
{ "dec", f_dec, 0 },
- { "drainwait", f_drainwait, F_NEEDARG },
{ "everything", f_everything, 0 },
{ "extproc", f_extproc, F_OFFOK },
{ "ispeed", f_ispeed, F_NEEDARG },
@@ -142,7 +140,7 @@ void
f_all(ip)
struct info *ip;
{
- print(&ip->t, &ip->win, ip->ldisc, ip->timeout, BSD);
+ print(&ip->t, &ip->win, ip->ldisc, BSD);
}
void
@@ -185,20 +183,11 @@ f_dec(ip)
}
void
-f_drainwait(ip)
- struct info *ip;
-{
-
- ip->timeout = atoi(ip->arg);
- ip->tset = 1;
-}
-
-void
f_everything(ip)
struct info *ip;
{
- print(&ip->t, &ip->win, ip->ldisc, ip->timeout, BSD);
+ print(&ip->t, &ip->win, ip->ldisc, BSD);
}
void
diff --git a/bin/stty/print.c b/bin/stty/print.c
index 6df106d..a0149c2 100644
--- a/bin/stty/print.c
+++ b/bin/stty/print.c
@@ -55,11 +55,10 @@ static void bput __P((char *));
static char *ccval __P((struct cchar *, int));
void
-print(tp, wp, ldisc, timeout, fmt)
+print(tp, wp, ldisc, fmt)
struct termios *tp;
struct winsize *wp;
int ldisc;
- int timeout;
enum FMT fmt;
{
struct cchar *p;
@@ -97,8 +96,7 @@ print(tp, wp, ldisc, timeout, fmt)
else
cnt += printf("speed %d baud;", ispeed);
if (fmt >= BSD)
- cnt += printf(" %d rows; %d columns; drainwait %d seconds;",
- wp->ws_row, wp->ws_col, timeout);
+ cnt += printf(" %d rows; %d columns;", wp->ws_row, wp->ws_col);
if (cnt)
(void)printf("\n");
diff --git a/bin/stty/stty.1 b/bin/stty/stty.1
index 7a5a582..26732d2 100644
--- a/bin/stty/stty.1
+++ b/bin/stty/stty.1
@@ -462,8 +462,6 @@ characters are set to ^?, ^U, and ^C;
is disabled, and
.Dv crt
is enabled.)
-.It Cm drainwait Ar number
-Set output drain timeout in seconds.
.It Cm extproc Pq Fl extproc
If set, this flag indicates that some amount of terminal processing is being
performed by either the terminal hardware or by the remote side connected
diff --git a/bin/stty/stty.c b/bin/stty/stty.c
index 355d1cd..3b59131 100644
--- a/bin/stty/stty.c
+++ b/bin/stty/stty.c
@@ -103,8 +103,6 @@ args: argc -= optind;
err(1, "TIOCGETD");
if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
warn("TIOCGWINSZ: %s\n", strerror(errno));
- if (ioctl(i.fd, TIOCGDRAINWAIT, &i.timeout) < 0)
- warn("TIOCGDRAINWAIT: %s\n", strerror(errno));
checkredirect(); /* conversion aid */
@@ -115,14 +113,14 @@ args: argc -= optind;
/* FALLTHROUGH */
case BSD:
case POSIX:
- print(&i.t, &i.win, i.ldisc, i.timeout, fmt);
+ print(&i.t, &i.win, i.ldisc, fmt);
break;
case GFLAG:
- gprint(&i.t, &i.win, i.ldisc, i.timeout);
+ gprint(&i.t, &i.win, i.ldisc);
break;
}
- for (i.set = i.wset = i.tset = 0; *argv; ++argv) {
+ for (i.set = i.wset = 0; *argv; ++argv) {
if (ksearch(&argv, &i))
continue;
@@ -143,7 +141,8 @@ args: argc -= optind;
}
if (!strncmp(*argv, "gfmt1", sizeof("gfmt1") - 1)) {
- gread(&i, *argv + sizeof("gfmt1") - 1);
+ gread(&i.t, *argv + sizeof("gfmt1") - 1);
+ i.set = 1;
continue;
}
@@ -155,8 +154,6 @@ args: argc -= optind;
err(1, "tcsetattr");
if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) < 0)
warn("TIOCSWINSZ");
- if (i.tset && ioctl(i.fd, TIOCSDRAINWAIT, &i.timeout) < 0)
- warn("TIOCSDRAINWAIT");
exit(0);
}
diff --git a/bin/stty/stty.h b/bin/stty/stty.h
index 6c9ed5e..e122979 100644
--- a/bin/stty/stty.h
+++ b/bin/stty/stty.h
@@ -43,11 +43,9 @@ struct info {
int off; /* turn off */
int set; /* need set */
int wset; /* need window set */
- int tset; /* need timeout set */
char *arg; /* argument */
struct termios t; /* terminal info */
struct winsize win; /* window info */
- int timeout; /* drain wait time */
};
struct cchar {
OpenPOWER on IntegriCloud