summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
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/arch/amd64
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/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/disksubr.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c
index 4315574787f..43cefac1dd2 100644
--- a/sys/arch/amd64/amd64/disksubr.c
+++ b/sys/arch/amd64/amd64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.56 2008/06/12 06:58:33 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.57 2009/08/13 15:23:10 deraadt Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -61,16 +61,16 @@
*/
bios_diskinfo_t *bios_getdiskinfo(dev_t dev);
-char *
+int
readdisklabel(dev_t dev, void (*strat)(struct buf *),
struct disklabel *lp, int spoofonly)
{
bios_diskinfo_t *pdi;
struct buf *bp = NULL;
dev_t devno;
- char *msg;
+ int error;
- if ((msg = initdisklabel(lp)))
+ if ((error = initdisklabel(lp)))
goto done;
/* Look for any BIOS geometry information we should honour. */
@@ -96,21 +96,19 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
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 == NULL)
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:
@@ -118,7 +116,7 @@ done:
bp->b_flags |= B_INVAL;
brelse(bp);
}
- return (msg);
+ return (error);
}
/*