kern/tty_pty.c, allocation of ptys was made dynamic with the introduction of
check_pty(). Every time a new struct pty is allocated its corresponding struct
tty is also allocated. It's therefore no longer necessary to ensure that a pty
has a tty allocated after calling check_pty().
ok deraadt@ millert@ mpi@ visa@
-/* $OpenBSD: tty_pty.c,v 1.89 2018/08/29 06:04:46 anton Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.90 2018/08/30 06:16:30 anton Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
return (error);
pti = pt_softc[minor(dev)];
- if (!pti->pt_tty) {
- tp = pti->pt_tty = ttymalloc(1000000);
- tp->t_dev = dev;
- } else
- tp = pti->pt_tty;
+ tp = pti->pt_tty;
if ((tp->t_state & TS_ISOPEN) == 0) {
tp->t_state |= TS_WOPEN;
ttychars(tp); /* Set up default chars */
return (error);
pti = pt_softc[minor(dev)];
- if (!pti->pt_tty) {
- tp = pti->pt_tty = ttymalloc(1000000);
- tp->t_dev = dev;
- } else
- tp = pti->pt_tty;
+ tp = pti->pt_tty;
if (tp->t_oproc)
return (EIO);
tp->t_oproc = ptsstart;