diff options
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r-- | sys/kern/tty_pty.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index a49334d7951..a158a80b18a 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.34 2007/05/29 00:17:32 thib Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.35 2007/09/07 15:00:20 art Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -154,8 +154,8 @@ ptyarralloc(int nelem) { struct pt_softc **pt; - pt = malloc(nelem * sizeof(struct pt_softc *), M_DEVBUF, M_WAITOK); - bzero(pt, nelem * sizeof(struct pt_softc *)); + pt = malloc(nelem * sizeof(struct pt_softc *), M_DEVBUF, + M_WAITOK|M_ZERO); return pt; } @@ -199,9 +199,8 @@ check_pty(int minor) * If the entry is not yet allocated, allocate one. */ if (!pt_softc[minor]) { - MALLOC(pti, struct pt_softc *, sizeof(struct pt_softc), - M_DEVBUF, M_WAITOK); - bzero(pti, sizeof(struct pt_softc)); + pti = malloc(sizeof(struct pt_softc), M_DEVBUF, + M_WAITOK|M_ZERO); pti->pt_tty = ttymalloc(); ptydevname(minor, pti); pt_softc[minor] = pti; |