Module Name:    src
Committed By:   mrg
Date:           Mon Jul  3 06:44:58 UTC 2017

Modified Files:
        src/sbin/gpt: biosboot.c

Log Message:
only do wedges if not the tools version.  fixes build on netbsd-4,
and any other place that might have the same ioctl name while having
something not quite right (in this case, cpuid_t in headers not
working properly..)

XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sbin/gpt/biosboot.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/gpt/biosboot.c
diff -u src/sbin/gpt/biosboot.c:1.27 src/sbin/gpt/biosboot.c:1.28
--- src/sbin/gpt/biosboot.c:1.27	Thu Feb 16 03:32:17 2017
+++ src/sbin/gpt/biosboot.c	Mon Jul  3 06:44:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosboot.c,v 1.27 2017/02/16 03:32:17 christos Exp $ */
+/*	$NetBSD: biosboot.c,v 1.28 2017/07/03 06:44:58 mrg Exp $ */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -37,18 +37,22 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$NetBSD: biosboot.c,v 1.27 2017/02/16 03:32:17 christos Exp $");
+__RCSID("$NetBSD: biosboot.c,v 1.28 2017/07/03 06:44:58 mrg Exp $");
 #endif
 
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
-#ifdef DIOCGWEDGEINFO
-#include <sys/disk.h>
-#endif
 #include <sys/param.h>
 #include <sys/bootblock.h>
 
+#if defined(DIOCGWEDGEINFO) && !defined(HAVE_NBTOOL_CONFIG_H)
+#define USE_WEDGES
+#endif
+#ifdef USE_WEDGES
+#include <sys/disk.h>
+#endif
+
 #include <err.h>
 #include <fcntl.h>
 #include <paths.h>
@@ -252,7 +256,7 @@ biosboot(gpt_t gpt, daddr_t start, uint6
 static int
 cmd_biosboot(gpt_t gpt, int argc, char *argv[])
 {
-#ifdef DIOCGWEDGEINFO
+#ifdef USE_WEDGES
 	struct dkwedge_info dkw;
 #endif
 	int ch;
@@ -289,7 +293,7 @@ cmd_biosboot(gpt_t gpt, int argc, char *
 	if (argc != optind)
 		return usage();
 
-#ifdef DIOCGWEDGEINFO
+#ifdef USE_WEDGES
 	if ((gpt->sb.st_mode & S_IFMT) != S_IFREG &&
 	    ioctl(gpt->fd, DIOCGWEDGEINFO, &dkw) != -1) {
 		if (entry > 0)

Reply via email to