diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-08-13 15:23:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-08-13 15:23:14 +0000 |
commit | cf6459c8f783ece5445be14e8e2e7201f7cd6632 (patch) | |
tree | a5a86e9615b432c0d3ef13f965013ddf06ea6bff /sys/arch/sparc/dev | |
parent | 46faf138ca97f0462a1c22674098875302fe10d0 (diff) |
Replace the error strings that were being passed around with much simpler
errnos. Note that the error strings are being ignored, since we long ago
decided to not spam the console, and there is no other nice way to use the
errors (without changing the ioctls to pass it back)
The errno is now useful, since we can pass b_error from failing IO up, and
the drive can decide how to use that
ok miod
Diffstat (limited to 'sys/arch/sparc/dev')
-rw-r--r-- | sys/arch/sparc/dev/fd.c | 13 | ||||
-rw-r--r-- | sys/arch/sparc/dev/xd.c | 14 | ||||
-rw-r--r-- | sys/arch/sparc/dev/xy.c | 16 |
3 files changed, 17 insertions, 26 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index 9c99fad9d59..070f4c029e1 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.65 2009/07/24 08:07:39 blambert Exp $ */ +/* $OpenBSD: fd.c,v 1.66 2009/08/13 15:23:12 deraadt Exp $ */ /* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */ /*- @@ -237,7 +237,7 @@ struct cfdriver fd_cd = { NULL, "fd", DV_DISK }; -void fdgetdisklabel(dev_t, struct fd_softc *, struct disklabel *, int); +int fdgetdisklabel(dev_t, struct fd_softc *, struct disklabel *, int); int fd_get_parms(struct fd_softc *); void fdstrategy(struct buf *); void fdstart(struct fd_softc *); @@ -1931,12 +1931,10 @@ fdformat(dev, finfo, p) return (rv); } -void +int fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp, int spoofonly) { - char *errstring; - bzero(lp, sizeof(struct disklabel)); lp->d_type = DTYPE_FLOPPY; @@ -1960,10 +1958,7 @@ fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp, /* * Call the generic disklabel extraction routine. */ - errstring = readdisklabel(DISKLABELDEV(dev), fdstrategy, lp, spoofonly); - if (errstring) { - /*printf("%s: %s\n", fd->sc_dv.dv_xname, errstring);*/ - } + return readdisklabel(DISKLABELDEV(dev), fdstrategy, lp, spoofonly); } void diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c index 096e3e758d7..dbdb87adbaf 100644 --- a/sys/arch/sparc/dev/xd.c +++ b/sys/arch/sparc/dev/xd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xd.c,v 1.44 2009/01/04 16:51:05 miod Exp $ */ +/* $OpenBSD: xd.c,v 1.45 2009/08/13 15:23:12 deraadt Exp $ */ /* $NetBSD: xd.c,v 1.37 1997/07/29 09:58:16 fair Exp $ */ /* @@ -296,7 +296,7 @@ xdgetdisklabel(xd, b) { struct disklabel *lp = xd->sc_dk.dk_label; struct sun_disklabel *sl = b; - char *err; + int error; bzero(lp, sizeof(struct disklabel)); /* Required parameters for readdisklabel() */ @@ -311,12 +311,10 @@ xdgetdisklabel(xd, b) /* We already have the label data in `b'; setup for dummy strategy */ xd_labeldata = b; - err = readdisklabel(MAKEDISKDEV(0, xd->sc_dev.dv_unit, RAW_PART), + error = readdisklabel(MAKEDISKDEV(0, xd->sc_dev.dv_unit, RAW_PART), xddummystrat, lp, 0); - if (err) { - /*printf("%s: %s\n", xd->sc_dev.dv_xname, err);*/ - return (XD_ERR_FAIL); - } + if (error) + return (error); /* Ok, we have the label; fill in `pcyl' if there's SunOS magic */ sl = b; @@ -336,7 +334,7 @@ xdgetdisklabel(xd, b) xd->nhead = lp->d_ntracks; xd->nsect = lp->d_nsectors; xd->sectpercyl = lp->d_secpercyl; - return (XD_ERR_AOK); + return (0); } /* diff --git a/sys/arch/sparc/dev/xy.c b/sys/arch/sparc/dev/xy.c index 4a10df3ca32..a4684a70c42 100644 --- a/sys/arch/sparc/dev/xy.c +++ b/sys/arch/sparc/dev/xy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xy.c,v 1.41 2009/01/04 16:51:05 miod Exp $ */ +/* $OpenBSD: xy.c,v 1.42 2009/08/13 15:23:12 deraadt Exp $ */ /* $NetBSD: xy.c,v 1.26 1997/07/19 21:43:56 pk Exp $ */ /* @@ -236,7 +236,7 @@ xygetdisklabel(xy, b) { struct disklabel *lp = xy->sc_dk.dk_label; struct sun_disklabel *sl = b; - char *err; + int error; bzero(lp, sizeof(struct disklabel)); /* Required parameters for readdisklabel() */ @@ -251,12 +251,10 @@ xygetdisklabel(xy, b) /* We already have the label data in `b'; setup for dummy strategy */ xy_labeldata = b; - err = readdisklabel(MAKEDISKDEV(0, xy->sc_dev.dv_unit, RAW_PART), + error = readdisklabel(MAKEDISKDEV(0, xy->sc_dev.dv_unit, RAW_PART), xydummystrat, lp, 0); - if (err) { - /*printf("%s: %s\n", xy->sc_dev.dv_xname, err);*/ - return (XY_ERR_FAIL); - } + if (error) + return (error); /* Ok, we have the label; fill in `pcyl' if there's SunOS magic */ sl = b; @@ -276,7 +274,7 @@ xygetdisklabel(xy, b) xy->nhead = lp->d_ntracks; xy->nsect = lp->d_nsectors; xy->sectpercyl = lp->d_secpercyl; - return (XY_ERR_AOK); + return (error); } /* @@ -596,7 +594,7 @@ xyattach(parent, self, aux) /* Attach the disk: must be before getdisklabel to malloc label */ disk_attach(&xy->sc_dk); - if (xygetdisklabel(xy, xa->buf) != XY_ERR_AOK) + if (xygetdisklabel(xy, xa->buf) != 0) goto done; /* inform the user of what is up */ |