diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-05-02 05:10:00 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-05-02 05:10:00 +0000 |
commit | 8520ad0af4a689230043e0672f3ddb870033d43f (patch) | |
tree | b54a8671cc3cbdc719ee762c1228928f9b1b830b /sys/arch/hp300 | |
parent | 06e9ec017feb47785da400103d3a692d751f098b (diff) |
Add defaults for d_secsize and d_secpercyl if they are zero (should not happen)
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r-- | sys/arch/hp300/hp300/disksubr.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arch/hp300/hp300/disksubr.c b/sys/arch/hp300/hp300/disksubr.c index 6e468667cf7..4d5c6a07281 100644 --- a/sys/arch/hp300/hp300/disksubr.c +++ b/sys/arch/hp300/hp300/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.7 1997/10/02 00:58:08 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.8 1998/05/02 05:09:59 millert Exp $ */ /* $NetBSD: disksubr.c,v 1.9 1997/04/01 03:12:13 scottr Exp $ */ /* @@ -75,8 +75,15 @@ readdisklabel(dev, strat, lp, osdep) struct disklabel *dlp; char *msg = NULL; + /* minimal requirements for archetypal disk label */ + if (lp->d_secsize == 0) + lp->d_secsize = DEV_BSIZE; if (lp->d_secperunit == 0) lp->d_secperunit = 0x1fffffff; + if (lp->d_secpercyl == 0) { + lp->d_secpercyl = 1; + } + lp->d_npartitions = 1; if (lp->d_partitions[0].p_size == 0) lp->d_partitions[0].p_size = 0x1fffffff; |