espo@bpa.UUCP (Bob Esposito) (02/02/86)
Here's my fix for the protection violation trap on a VAX in tty.c Bob Esposito ... bpa!espo ***** tty.c /* * common ioctl tty code */ ttiocom(tp, cmd, arg, mode) register struct tty *tp; { register flag; struct termio cb; struct sgttyb tb; + extern nulldev(); switch(cmd) { ------------------------------------------ case TCSETA: if (copyin(arg, &cb, sizeof cb)) { u.u_error = EFAULT; break; } if (tp->t_line != cb.c_line) { if (cb.c_line < 0 || cb.c_line >= linecnt) { u.u_error = EINVAL; break; } + if (linesw[cb.c_line].l_ioctl == nulldev) { + u.u_error = EINVAL; + break; + } (*linesw[tp->t_line].l_ioctl)(tp, LDCLOSE, 0, mode); }