summaryrefslogtreecommitdiff
path: root/sys/arch/hp300
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-08-16 12:17:36 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-08-16 12:17:36 +0000
commitd39458989190c77326d1ae3d1a28626da1d0b774 (patch)
treead796859d33887496f082816ab540baffa09e8f3 /sys/arch/hp300
parent22190c1376c8d6bb79d18384ed8d80b1fa83ba12 (diff)
Update to cope with new readdisklabel() return value.
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r--sys/arch/hp300/dev/hd.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sys/arch/hp300/dev/hd.c b/sys/arch/hp300/dev/hd.c
index 1b9844ce219..5fc24a0a1c5 100644
--- a/sys/arch/hp300/dev/hd.c
+++ b/sys/arch/hp300/dev/hd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hd.c,v 1.57 2009/06/13 21:35:58 miod Exp $ */
+/* $OpenBSD: hd.c,v 1.58 2009/08/16 12:17:35 miod Exp $ */
/* $NetBSD: rd.c,v 1.33 1997/07/10 18:14:08 kleink Exp $ */
/*
@@ -238,7 +238,7 @@ int hdident(struct device *, struct hd_softc *,
struct hpibbus_attach_args *);
void hdreset(int, int, int);
void hdustart(struct hd_softc *);
-void hdgetdisklabel(dev_t, struct hd_softc *, struct disklabel *, int);
+int hdgetdisklabel(dev_t, struct hd_softc *, struct disklabel *, int);
void hdrestart(void *);
struct buf *hdfinish(struct hd_softc *, struct buf *);
@@ -476,15 +476,13 @@ hdreset(ctlr, slave, punit)
/*
* Read or construct a disklabel
*/
-void
+int
hdgetdisklabel(dev, rs, lp, spoofonly)
dev_t dev;
struct hd_softc *rs;
struct disklabel *lp;
int spoofonly;
{
- char *errstring;
-
bzero(lp, sizeof(struct disklabel));
/*
@@ -523,12 +521,7 @@ hdgetdisklabel(dev, rs, lp, spoofonly)
/*
* Now try to read the disklabel
*/
- errstring = readdisklabel(DISKLABELDEV(dev), hdstrategy, lp,
- spoofonly);
- if (errstring) {
- /* printf("%s: %s\n", rs->sc_dev.dv_xname, errstring); */
- return;
- }
+ return readdisklabel(DISKLABELDEV(dev), hdstrategy, lp, spoofonly);
}
int
@@ -566,8 +559,10 @@ hdopen(dev, flags, mode, p)
*/
if (rs->sc_dkdev.dk_openmask == 0) {
rs->sc_flags |= HDF_OPENING;
- hdgetdisklabel(dev, rs, rs->sc_dkdev.dk_label, 0);
+ error = hdgetdisklabel(dev, rs, rs->sc_dkdev.dk_label, 0);
rs->sc_flags &= ~HDF_OPENING;
+ if (error == EIO)
+ goto out;
}
part = DISKPART(dev);