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/mvmeppc | |
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/mvmeppc')
-rw-r--r-- | sys/arch/mvmeppc/mvmeppc/disksubr.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/arch/mvmeppc/mvmeppc/disksubr.c b/sys/arch/mvmeppc/mvmeppc/disksubr.c index 6db60e52d88..a35f34cf7d3 100644 --- a/sys/arch/mvmeppc/mvmeppc/disksubr.c +++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.57 2008/06/12 06:58:36 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.58 2009/08/13 15:23:11 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -55,35 +55,33 @@ * * Returns null on success and an error string on failure. */ -char * +int readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, int spoofonly) { struct buf *bp = NULL; - char *msg; + int error; - if ((msg = initdisklabel(lp))) + if ((error = initdisklabel(lp))) goto done; /* get a buffer and initialize it */ bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; - msg = readdoslabel(bp, strat, lp, NULL, spoofonly); - if (msg == NULL) + error = readdoslabel(bp, strat, lp, NULL, spoofonly); + if (error == 0) goto done; #if defined(CD9660) - if (iso_disklabelspoof(dev, strat, lp) == 0) { - msg = NULL; + error = iso_disklabelspoof(dev, strat, lp); + if (error == 0) goto done; - } #endif #if defined(UDF) - if (udf_disklabelspoof(dev, strat, lp) == 0) { - msg = NULL; + error = udf_disklabelspoof(dev, strat, lp); + if (error == 0) goto done; - } #endif done: @@ -91,7 +89,7 @@ done: bp->b_flags |= B_INVAL; brelse(bp); } - return (msg); + return (error); } /* |