diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-04-14 20:02:49 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-04-14 20:02:49 +0000 |
commit | 82a4345ea4a1f73b810faec7e3cd3e4b99cd46d7 (patch) | |
tree | bdf58f96b2b687e2000423a47f50d1825982d084 /sbin/disklabel | |
parent | 936e98a94c4eaafa4983b0ab26172f0b9c81f265 (diff) |
Set label.d_bbsize and label.d_sbsize if we have a fictious label
and they are zero. Fixes "disklabel -B" on hp300 and the warning
about zero size bootblock and superblock fields on all ports.
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/editor.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 1f2468f5d53..0bbb74f6ba9 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.33 1998/04/11 10:14:19 deraadt Exp $ */ +/* $OpenBSD: editor.c,v 1.34 1998/04/14 20:02:48 millert Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.33 1998/04/11 10:14:19 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.34 1998/04/14 20:02:48 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -148,10 +148,17 @@ editor(lp, f) #if defined(OLD_SCSI) /* Some ports use the old scsi system that doesn't get the geom right */ - if (strcmp(label.d_typename, "fictitious") == 0) + if (strcmp(label.d_packname, "fictitious") == 0) puts("Warning, driver-generated label. Disk parameters may be " "incorrect."); #endif + /* Set d_bbsize and d_sbsize as neccesary */ + if (strcmp(label.d_packname, "fictitious") == 0) { + if (label.d_bbsize == 0) + label.d_bbsize = BBSIZE; + if (label.d_sbsize == 0) + label.d_sbsize = SBSIZE; + } puts("\nInitial label editor (enter '?' for help at any prompt)"); lastlabel = label; |