Fix bugs:

cchars2 not used
can't set or report MIN or TIME == 255
TIOCSETD on wrong fd
PPPDISC is not reported
This commit is contained in:
Andrey A. Chernov 1995-04-28 19:29:30 +00:00
parent 8312577eea
commit 0b51c95db2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8148
3 changed files with 11 additions and 14 deletions

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: cchar.c,v 1.2 1994/09/24 02:58:55 davidg Exp $
*/
#ifndef lint
@ -106,8 +106,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);
@ -122,11 +122,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);
usage();
}
if (val > UCHAR_MAX) {
warnx("maximum option value is %d -- %s",
UCHAR_MAX, name);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: key.c,v 1.2 1994/09/24 02:58:58 davidg Exp $
* $Id: key.c,v 1.3 1995/03/19 13:29:25 joerg Exp $
*/
#ifndef lint
@ -296,6 +296,6 @@ f_tty(ip)
int tmp;
tmp = TTYDISC;
if (ioctl(0, TIOCSETD, &tmp) < 0)
if (ioctl(ip->fd, TIOCSETD, &tmp) < 0)
err(1, "TIOCSETD");
}

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: print.c,v 1.2 1994/09/24 02:58:59 davidg Exp $
*/
#ifndef lint
@ -74,6 +74,9 @@ print(tp, wp, ldisc, fmt)
case SLIPDISC:
cnt += printf("slip disc; ");
break;
case PPPDISC:
cnt += printf("ppp disc; ");
break;
default:
cnt += printf("#%d disc; ", ldisc);
break;
@ -240,13 +243,12 @@ 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';