Source-Changes-HG archive

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

[src/trunk]: src/sbin/gpt only do wedges if not the tools version. fixes bui...



details:   https://anonhg.NetBSD.org/src/rev/14a247f7cfca
branches:  trunk
changeset: 825196:14a247f7cfca
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Jul 03 06:44:58 2017 +0000

description:
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

diffstat:

 sbin/gpt/biosboot.c |  18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r eca4793b5c02 -r 14a247f7cfca sbin/gpt/biosboot.c
--- a/sbin/gpt/biosboot.c       Mon Jul 03 06:01:16 2017 +0000
+++ b/sbin/gpt/biosboot.c       Mon Jul 03 06:44:58 2017 +0000
@@ -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,17 +37,21 @@
 
 #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/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 <sys/param.h>
-#include <sys/bootblock.h>
 
 #include <err.h>
 #include <fcntl.h>
@@ -252,7 +256,7 @@
 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 @@
        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)



Home | Main Index | Thread Index | Old Index