diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-04-30 04:55:47 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-04-30 04:55:47 +0000 |
commit | c3a1d09768d20495f75e59ddfb146a050c2b99f1 (patch) | |
tree | ebc8285e1d55272825ed28bbda539aa6fb077a9e /sys/arch | |
parent | 6f77ea48ddab3fb5a31c157f65532fa94eb56aeb (diff) |
Only use scsi geometry to fake up a label if we were able to get
the capacity. Fixes a panic with fictitious labels on zip drives.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hp300/dev/sd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/hp300/dev/sd.c b/sys/arch/hp300/dev/sd.c index 78de6345edb..6ca16d60237 100644 --- a/sys/arch/hp300/dev/sd.c +++ b/sys/arch/hp300/dev/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.15 1998/04/25 00:38:15 millert Exp $ */ +/* $OpenBSD: sd.c,v 1.16 1998/04/30 04:55:46 millert Exp $ */ /* $NetBSD: sd.c,v 1.34 1997/07/10 18:14:10 kleink Exp $ */ /* @@ -435,7 +435,8 @@ sdgetinfo(dev) sc->sc_blksize = DEV_BSIZE; /* Fill in info from disk geometry if it exists. */ - if (sc->sc_blks != 0 && sc->sc_heads != 0 && sc->sc_cyls != 0) { + if (sc->sc_format_pid >= 0 && sc->sc_blks > 0 && + sc->sc_heads > 0 && sc->sc_cyls > 0) { lp->d_secperunit = sc->sc_blks >> sc->sc_bshift; lp->d_ntracks = sc->sc_heads; lp->d_ncylinders = sc->sc_cyls; |