Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/disklabel Fix disklabel -t to work with disks that don'...



details:   https://anonhg.NetBSD.org/src/rev/741282cdb4ab
branches:  trunk
changeset: 472442:741282cdb4ab
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Thu Apr 29 19:12:07 1999 +0000

description:
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@localhost>.

diffstat:

 sbin/disklabel/disklabel.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r f01655b230a4 -r 741282cdb4ab sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c        Thu Apr 29 19:03:03 1999 +0000
+++ b/sbin/disklabel/disklabel.c        Thu Apr 29 19:12:07 1999 +0000
@@ -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 @@
 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 @@
        (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 = "";



Home | Main Index | Thread Index | Old Index