summaryrefslogtreecommitdiff
path: root/sys/dev/ccd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-08-13 15:23:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-08-13 15:23:14 +0000
commitcf6459c8f783ece5445be14e8e2e7201f7cd6632 (patch)
treea5a86e9615b432c0d3ef13f965013ddf06ea6bff /sys/dev/ccd.c
parent46faf138ca97f0462a1c22674098875302fe10d0 (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/dev/ccd.c')
-rw-r--r--sys/dev/ccd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 18169e5efd2..d6c13072962 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.86 2009/06/04 05:57:27 krw Exp $ */
+/* $OpenBSD: ccd.c,v 1.87 2009/08/13 15:23:11 deraadt Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -175,7 +175,7 @@ int ccdinit(struct ccddevice *, char **, struct proc *);
int ccdlookup(char *, struct proc *p, struct vnode **);
long ccdbuffer(struct ccd_softc *, struct buf *, daddr64_t, caddr_t,
long, struct ccdbuf **);
-void ccdgetdisklabel(dev_t, struct ccd_softc *, struct disklabel *, int);
+int ccdgetdisklabel(dev_t, struct ccd_softc *, struct disklabel *, int);
INLINE struct ccdbuf *getccdbuf(void);
INLINE void putccdbuf(struct ccdbuf *);
@@ -1353,12 +1353,11 @@ ccdlookup(char *path, struct proc *p, struct vnode **vpp)
* Read the disklabel from the ccd. If one is not present, fake one
* up.
*/
-void
+int
ccdgetdisklabel(dev_t dev, struct ccd_softc *cs, struct disklabel *lp,
int spoofonly)
{
struct ccdgeom *ccg = &cs->sc_geom;
- char *errstring;
bzero(lp, sizeof(*lp));
@@ -1384,11 +1383,8 @@ ccdgetdisklabel(dev_t dev, struct ccd_softc *cs, struct disklabel *lp,
/*
* Call the generic disklabel extraction routine.
*/
- errstring = readdisklabel(DISKLABELDEV(dev), ccdstrategy,
+ return readdisklabel(DISKLABELDEV(dev), ccdstrategy,
cs->sc_dkdev.dk_label, spoofonly);
- /* It's actually extremely common to have unlabeled ccds. */
- if (errstring != NULL)
- CCD_DPRINTF(CCDB_LABEL, ("%s: %s\n", cs->sc_xname, errstring));
}
#ifdef CCDDEBUG