summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2010-03-22 15:25:48 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2010-03-22 15:25:48 +0000
commit6d3f0147c9d9d8f0c2057e79021bf47e98e1a3d0 (patch)
tree41a904b35a084ec4463664b3ca97617ef2d93ea6 /sbin
parent95e75b4583564c5658046a2d8c00605b441cbf74 (diff)
introduce HAS_MBR and let make define it for the right machines;
requested by miod@; ok miod@ krw@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fdisk/Makefile8
-rw-r--r--sbin/fdisk/fdisk.c5
2 files changed, 9 insertions, 4 deletions
diff --git a/sbin/fdisk/Makefile b/sbin/fdisk/Makefile
index 4d7cb7f12e3..1f82822b022 100644
--- a/sbin/fdisk/Makefile
+++ b/sbin/fdisk/Makefile
@@ -1,5 +1,5 @@
#
-# $OpenBSD: Makefile,v 1.36 2007/11/25 15:56:28 deraadt Exp $
+# $OpenBSD: Makefile,v 1.37 2010/03/22 15:25:47 otto Exp $
#
# Copyright (c) 1997 Tobias Weingartner
# All rights reserved.
@@ -47,4 +47,10 @@ manual.c: fdisk.cat8
MAN= fdisk.8
+.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || \
+ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \
+ ${MACHINE} == "macppc" || ${MACHINE} == "socppc"
+CFLAGS += -DHAS_MBR
+.endif
+
.include <bsd.prog.mk>
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index c1f5ef763c0..edd515a4648 100644
--- a/sbin/fdisk/fdisk.c
+++ b/sbin/fdisk/fdisk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fdisk.c,v 1.49 2010/02/17 20:19:05 otto Exp $ */
+/* $OpenBSD: fdisk.c,v 1.50 2010/03/22 15:25:47 otto Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -71,8 +71,7 @@ main(int argc, char *argv[])
int c_arg = 0, h_arg = 0, s_arg = 0;
disk_t disk;
DISK_metrics *usermetrics;
-#if defined(__amd64__) || defined(__i386__) || defined (__powerpc__) || \
- defined(__sh__) || defined(__MIPSEL__)
+#ifdef HAS_MBR
char *mbrfile = _PATH_MBR;
#else
char *mbrfile = NULL;