Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sbin/disklabel pullup 1.69->1.70 (cgd)



details:   https://anonhg.NetBSD.org/src/rev/c45f661b314b
branches:  netbsd-1-4
changeset: 468874:c45f661b314b
user:      perry <perry%NetBSD.org@localhost>
date:      Mon Jun 21 23:21:36 1999 +0000

description:
pullup 1.69->1.70 (cgd)

diffstat:

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

diffs (39 lines):

diff -r 8824be87cf46 -r c45f661b314b sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c        Mon Jun 21 23:19:57 1999 +0000
+++ b/sbin/disklabel/disklabel.c        Mon Jun 21 23:21:36 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.c,v 1.63.2.3 1999/04/30 15:15:43 perry Exp $ */
+/*     $NetBSD: disklabel.c,v 1.63.2.4 1999/06/21 23:21:36 perry 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.63.2.3 1999/04/30 15:15:43 perry Exp $");
+__RCSID("$NetBSD: disklabel.c,v 1.63.2.4 1999/06/21 23:21:36 perry Exp $");
 #endif
 #endif /* not lint */
 
@@ -883,6 +883,20 @@
        lp = (struct disklabel *)
                (boot + (LABELSECTOR * dp->d_secsize) + LABELOFFSET);
        (void) memset(lp, 0, sizeof *lp);
+#ifdef SAVEBOOTAREA
+       /*
+        * We must read the current bootarea so we don't clobber the
+        * existing boot block, if any.
+        */
+       if (rflag) {
+               off_t sectoffset = 0;
+
+               if (lseek(f, sectoffset, SEEK_SET) < 0 ||
+                   read(f, boot, BBSIZE) < BBSIZE)
+                       err(4, "%s", specname);
+               (void) memset(lp, 0, sizeof *lp);
+       }
+#endif
 #if NUMBOOT > 0
        /*
         * If we are not installing a boot program but we are installing a



Home | Main Index | Thread Index | Old Index