svn commit: r197322 - head/lib/libdisk

Takahashi Yoshihiro nyan at FreeBSD.org
Sat Sep 19 03:33:18 UTC 2009


Author: nyan
Date: Sat Sep 19 03:33:18 2009
New Revision: 197322
URL: http://svn.freebsd.org/changeset/base/197322

Log:
  Correct BIOS header sanitizing on pc98.
  
  MFC after:	3 days

Modified:
  head/lib/libdisk/change.c

Modified: head/lib/libdisk/change.c
==============================================================================
--- head/lib/libdisk/change.c	Sat Sep 19 01:49:36 2009	(r197321)
+++ head/lib/libdisk/change.c	Sat Sep 19 03:33:18 2009	(r197322)
@@ -36,14 +36,17 @@ Sanitize_Bios_Geom(struct disk *disk)
 
 	if (disk->bios_cyl >= 65536)
 		sane = 0;
-	if (disk->bios_hd > 256)
-		sane = 0;
 #ifdef PC98
+	if (disk->bios_hd >= 256)
+		sane = 0;
 	if (disk->bios_sect >= 256)
+		sane = 0;
 #else
+	if (disk->bios_hd > 256)
+		sane = 0;
 	if (disk->bios_sect > 63)
-#endif
 		sane = 0;
+#endif
 	if (disk->bios_cyl * disk->bios_hd * disk->bios_sect !=
 	    disk->chunks->size)
 		sane = 0;


More information about the svn-src-head mailing list