summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2003-09-18 06:55:56 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2003-09-18 06:55:56 +0000
commitcc4ca7a7d7008c7f7e3aa56aad94a6284eb2e5bb (patch)
treedbea37e0d380c6a7943f4748a9be0fb1f5d56abe /sys/arch/i386
parent701c35a9b7b3371dae12746f0c65da8307fcad2d (diff)
- pass the correct device to bios_getdisklabel().
- don't blindly return but check whether bios_getdisklabel() failed and act according. this fixes (at some extent) booting from a floppy if it wasn't inserted during floppyprobe(). toby@ ok.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index 6935a2a709f..71ade047420 100644
--- a/sys/arch/i386/stand/libsa/biosdev.c
+++ b/sys/arch/i386/stand/libsa/biosdev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosdev.c,v 1.62 2003/09/16 03:43:11 fgsch Exp $ */
+/* $OpenBSD: biosdev.c,v 1.63 2003/09/18 06:55:55 fgsch Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -456,11 +456,17 @@ biosopen(struct open_file *f, ...)
/* Try for disklabel again (might be removable media) */
if(dip->bios_info.flags & BDI_BADLABEL){
- const char *st = bios_getdisklabel((void *)biosdev, &dip->disklabel);
+ const char *st = bios_getdisklabel(&dip->bios_info,
+ &dip->disklabel);
+#ifdef BIOS_DEBUG
if (debug && st)
printf("%s\n", st);
-
- return ERDLAB;
+#endif
+ if (!st) {
+ dip->bios_info.flags &= ~BDI_BADLABEL;
+ dip->bios_info.flags |= BDI_GOODLABEL;
+ } else
+ return (ERDLAB);
}
f->f_devdata = dip;