aboutsummaryrefslogtreecommitdiff
path: root/bin/stty
diff options
context:
space:
mode:
Diffstat (limited to 'bin/stty')
-rw-r--r--bin/stty/cchar.c10
-rw-r--r--bin/stty/gfmt.c4
-rw-r--r--bin/stty/key.c2
-rw-r--r--bin/stty/print.c10
4 files changed, 14 insertions, 12 deletions
diff --git a/bin/stty/cchar.c b/bin/stty/cchar.c
index b8e6206cfa59..c105f96c2081 100644
--- a/bin/stty/cchar.c
+++ b/bin/stty/cchar.c
@@ -60,12 +60,14 @@ struct cchar cchars1[] = {
"intr", VINTR, CINTR,
"kill", VKILL, CKILL,
"lnext", VLNEXT, CLNEXT,
+ "min", VMIN, CMIN,
"quit", VQUIT, CQUIT,
"reprint", VREPRINT, CREPRINT,
"start", VSTART, CSTART,
"status", VSTATUS, CSTATUS,
"stop", VSTOP, CSTOP,
"susp", VSUSP, CSUSP,
+ "time", VTIME, CTIME,
"werase", VWERASE, CWERASE,
NULL,
};
@@ -95,8 +97,8 @@ csearch(argvp, ip)
tmp.name = name;
if (!(cp = (struct cchar *)bsearch(&tmp, cchars1,
sizeof(cchars1)/sizeof(struct cchar) - 1, sizeof(struct cchar),
- c_cchar)) && !(cp = (struct cchar *)bsearch(&tmp, cchars1,
- sizeof(cchars1)/sizeof(struct cchar) - 1, sizeof(struct cchar),
+ c_cchar)) && !(cp = (struct cchar *)bsearch(&tmp, cchars2,
+ sizeof(cchars2)/sizeof(struct cchar) - 1, sizeof(struct cchar),
c_cchar)))
return(0);
@@ -109,10 +111,6 @@ csearch(argvp, ip)
ip->t.c_cc[cp->sub] = _POSIX_VDISABLE;
else if (cp->sub == VMIN || cp->sub == VTIME) {
val = strtol(arg, &ep, 10);
- if (val == _POSIX_VDISABLE) {
- warnx("value of %ld would disable the option -- %s",
- val, name);
- }
if (val > UCHAR_MAX) {
warnx("maximum option value is %d -- %s",
UCHAR_MAX, name);
diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c
index d909131ee32c..97021bb31ba3 100644
--- a/bin/stty/gfmt.c
+++ b/bin/stty/gfmt.c
@@ -163,12 +163,12 @@ gread(tp, s)
tp->c_cc[VSUSP] = tmp;
continue;
}
- if (CHK("vmin")) {
+ if (CHK("min")) {
(void)sscanf(ep, "%ld", &tmp);
tp->c_cc[VMIN] = tmp;
continue;
}
- if (CHK("vtime")) {
+ if (CHK("time")) {
(void)sscanf(ep, "%ld", &tmp);
tp->c_cc[VTIME] = tmp;
continue;
diff --git a/bin/stty/key.c b/bin/stty/key.c
index 6a7aeca935e2..1f7114864058 100644
--- a/bin/stty/key.c
+++ b/bin/stty/key.c
@@ -276,6 +276,6 @@ f_tty(ip)
int tmp;
tmp = TTYDISC;
- if (ioctl(0, TIOCSETD, &tmp) < 0)
+ if (ioctl(ip->fd, TIOCSETD, &tmp) < 0)
err("TIOCSETD: %s", strerror(errno));
}
diff --git a/bin/stty/print.c b/bin/stty/print.c
index a3ef040efbec..fdd2f72c406d 100644
--- a/bin/stty/print.c
+++ b/bin/stty/print.c
@@ -74,6 +74,9 @@ print(tp, wp, ldisc, fmt)
case NTTYDISC:
cnt += printf("new tty disc; ");
break;
+ case PPPDISC:
+ cnt += printf("ppp disc; ");
+ break;
default:
cnt += printf("#%d disc; ", ldisc);
break;
@@ -250,13 +253,14 @@ ccval(p, c)
static char buf[5];
char *bp;
- if (c == _POSIX_VDISABLE)
- return("<undef>");
-
if (p->sub == VMIN || p->sub == VTIME) {
(void)snprintf(buf, sizeof(buf), "%d", c);
return (buf);
}
+
+ if (c == _POSIX_VDISABLE)
+ return("<undef>");
+
bp = buf;
if (c & 0200) {
*bp++ = 'M';