Module Name:    src
Committed By:   christos
Date:           Fri Jan  2 19:46:02 UTC 2015

Modified Files:
        src/sbin/disklabel: main.c
        src/usr.sbin/bad144: bad144.c
        src/usr.sbin/diskpart: diskpart.c

Log Message:
Fix the 3 programs that use DTYPE_ (disklabel disk types) constants from the
kernel. Two of them are inside ifdefs.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/disklabel/main.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/bad144/bad144.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/diskpart/diskpart.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/disklabel/main.c
diff -u src/sbin/disklabel/main.c:1.42 src/sbin/disklabel/main.c:1.43
--- src/sbin/disklabel/main.c:1.42	Fri Sep 19 13:45:03 2014
+++ src/sbin/disklabel/main.c	Fri Jan  2 14:46:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.42 2014/09/19 17:45:03 matt Exp $	*/
+/*	$NetBSD: main.c,v 1.43 2015/01/02 19:46:02 christos Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 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: main.c,v 1.42 2014/09/19 17:45:03 matt Exp $");
+__RCSID("$NetBSD: main.c,v 1.43 2015/01/02 19:46:02 christos Exp $");
 #endif
 #endif	/* not lint */
 
@@ -793,7 +793,7 @@ write_label(int f)
 	}
 
 #ifdef VAX_ALTLABELS
-	if (lab.d_type == DTYPE_SMD && lab.d_flags & D_BADSECT &&
+	if (lab.d_type == DKTYPE_SMD && lab.d_flags & D_BADSECT &&
 	    lab.d_secsize == 512) {
 		/* Write the label to the odd sectors of the last track! */
 		daddr_t	alt;

Index: src/usr.sbin/bad144/bad144.c
diff -u src/usr.sbin/bad144/bad144.c:1.30 src/usr.sbin/bad144/bad144.c:1.31
--- src/usr.sbin/bad144/bad144.c:1.30	Sat Nov  2 20:48:52 2013
+++ src/usr.sbin/bad144/bad144.c	Fri Jan  2 14:46:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bad144.c,v 1.30 2013/11/03 00:48:52 christos Exp $	*/
+/*	$NetBSD: bad144.c,v 1.31 2015/01/02 19:46:02 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)bad144.c	8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: bad144.c,v 1.30 2013/11/03 00:48:52 christos Exp $");
+__RCSID("$NetBSD: bad144.c,v 1.31 2015/01/02 19:46:02 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -168,7 +168,7 @@ main(int argc, char *argv[])
 		errx(7, "Disk sector size too large/small (%d)",
 		    dp->d_secsize);
 #ifdef __i386__
-	if (dp->d_type == DTYPE_SCSI)
+	if (dp->d_type == DKTYPE_SCSI)
 		errx(1, "SCSI disks don't use bad144!");
 	/* are we inside a DOS partition? */
 	if (dp->d_partitions[0].p_offset) {

Index: src/usr.sbin/diskpart/diskpart.c
diff -u src/usr.sbin/diskpart/diskpart.c:1.19 src/usr.sbin/diskpart/diskpart.c:1.20
--- src/usr.sbin/diskpart/diskpart.c:1.19	Tue Aug 30 06:12:06 2011
+++ src/usr.sbin/diskpart/diskpart.c	Fri Jan  2 14:46:02 2015
@@ -37,7 +37,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "from: @(#)diskpart.c	8.3 (Berkeley) 11/30/94";
 #else
-__RCSID("$NetBSD: diskpart.c,v 1.19 2011/08/30 10:12:06 joerg Exp $");
+__RCSID("$NetBSD: diskpart.c,v 1.20 2015/01/02 19:46:02 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -181,7 +181,7 @@ main(int argc, char *argv[])
 	 * bad sectors are mapped.
 	 * If disk size was specified explicitly, use specified size.
 	 */
-	if (dp->d_type == DTYPE_SMD && dp->d_flags & D_BADSECT &&
+	if (dp->d_type == DKTYPE_SMD && dp->d_flags & D_BADSECT &&
 	    totsize == 0) {
 		badsecttable = dp->d_nsectors +
 		    roundup(badsecttable, dp->d_nsectors);
@@ -267,7 +267,7 @@ main(int argc, char *argv[])
 				printf("\t0,\t0,\n");
 				continue;
 			}
-			if (dp->d_type != DTYPE_MSCP) {
+			if (dp->d_type != DKTYPE_MSCP) {
 			       printf("\t%d,\t%d,\t\t/* %c=cyl %d thru %d */\n",
 					defpart[def][part], startcyl[part],
 					'A' + part, startcyl[part],
@@ -304,7 +304,7 @@ main(int argc, char *argv[])
 			dp->d_nsectors, dp->d_ntracks, dp->d_ncylinders);
 		if (dp->d_secpercyl != dp->d_nsectors * dp->d_ntracks)
 			printf("sc#%d:", dp->d_secpercyl);
-		if (dp->d_type == DTYPE_SMD && dp->d_flags & D_BADSECT)
+		if (dp->d_type == DKTYPE_SMD && dp->d_flags & D_BADSECT)
 			printf("sf:");
 		printf("\\\n\t:dt=%s:", dktypenames[dp->d_type]);
 		for (part = NDDATA - 1; part >= 0; part--)
@@ -434,7 +434,7 @@ gettype:
 		goto gettype;
 	}
 	fprintf(stderr, "(type <cr> to get default value, if only one)\n");
-	if (dp->d_type == DTYPE_SMD) {
+	if (dp->d_type == DKTYPE_SMD) {
 		fprintf(stderr,
 		    "Do '%s' disks support bad144 bad block forwarding (yes)? ",
 		    dp->d_typename);

Reply via email to