diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-09-18 16:22:45 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-09-18 16:22:45 +0000 |
commit | 804b9ee7e1e55305a39d9af075e6be189430a1e3 (patch) | |
tree | fa31b926888ac702203c1d596208394b6d1dd0ca /sys/arch/i386 | |
parent | 2b7c02b235afb749f7d5c7b088b66b815f390077 (diff) |
set t_dev before tty_attach(), so that pstat -s doesn't see a dev_t of 0
when the device has not been opened yet.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_drv.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_drv.c b/sys/arch/i386/isa/pcvt/pcvt_drv.c index c7efe297a34..dc333ef6ab0 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_drv.c +++ b/sys/arch/i386/isa/pcvt/pcvt_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_drv.c,v 1.15 1997/01/27 23:20:59 deraadt Exp $ */ +/* $OpenBSD: pcvt_drv.c,v 1.16 1997/09/18 16:22:44 deraadt Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -171,6 +171,9 @@ pcattach(struct isa_device *dev) { #endif /* PCVT_NETBSD > 9 */ +#if PCVT_NETBSD >= 120 + int maj; +#endif int i; if(do_initialization) @@ -240,12 +243,20 @@ pcattach(struct isa_device *dev) #if PCVT_NETBSD || (PCVT_FREEBSD > 110 && PCVT_FREEBSD < 200) +#if PCVT_NETBSD >= 120 + for (maj = 0; maj < nchrdev; maj++) { + if ((u_int)cdevsw[maj].d_open == (u_int)pcopen) + break; + } +#endif /* PCVT_NETBSD >= 120 */ + for(i = 0; i < totalscreens; i++) { #if PCVT_NETBSD > 100 vs[i].vs_tty = ttymalloc(); #if PCVT_NETBSD >= 120 + vs[i].vs_tty->t_dev = makedev(maj, i); tty_attach(vs[i].vs_tty); #endif /* PCVT_NETBSD >= 120 */ #else /* !PCVT_NETBSD > 100 */ |