Fix disklabel -t to work with disks that don't end on a cylinder. Before it

wasn't adding a "su" entry, so when the disktab was read, the sectors per
unit was initialized to "nc"*"sc" which was wrong.

Fixes PR/7446 reported by Matthias Buelow <mkb@altair.mayn.de>.
This commit is contained in:
wrstuden 1999-04-29 19:12:07 +00:00
parent 22939f25dd
commit e312a3c208

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.c,v 1.66 1999/04/26 02:05:46 abs Exp $ */
/* $NetBSD: disklabel.c,v 1.67 1999/04/29 19:12:07 wrstuden Exp $ */
/*
* Copyright (c) 1987, 1993
@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\
static char sccsid[] = "@(#)disklabel.c 8.4 (Berkeley) 5/4/95";
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#else
__RCSID("$NetBSD: disklabel.c,v 1.66 1999/04/26 02:05:46 abs Exp $");
__RCSID("$NetBSD: disklabel.c,v 1.67 1999/04/29 19:12:07 wrstuden Exp $");
#endif
#endif /* not lint */
@ -1021,6 +1021,10 @@ makedisktab(f, lp)
(void) fprintf(f, "sc#%d:", lp->d_secpercyl);
(void) fprintf(f, "nc#%d:", lp->d_ncylinders);
if ((lp->d_secpercyl * lp->d_ncylinders) != lp->d_secperunit) {
(void) fprintf(f, "%ssu#%d:", did, lp->d_secperunit);
did = "";
}
if (lp->d_rpm != 3600) {
(void) fprintf(f, "%srm#%d:", did, lp->d_rpm);
did = "";