From: Karel Zak Date: Wed, 26 Jun 2013 09:46:09 +0000 (+0200) Subject: fdisk: (bsd) use macros from pt-mbr.h X-Git-Tag: v2.24-rc1~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e24c3adf14d7d3988cc9a28a2a89d0402d8606b;p=thirdparty%2Futil-linux.git fdisk: (bsd) use macros from pt-mbr.h Signed-off-by: Karel Zak --- diff --git a/fdisks/fdiskbsdlabel.c b/fdisks/fdiskbsdlabel.c index 01c6ca3ca2..64d266270a 100644 --- a/fdisks/fdiskbsdlabel.c +++ b/fdisks/fdiskbsdlabel.c @@ -58,8 +58,6 @@ #include "fdisk.h" #include "pt-mbr.h" -#define FREEBSD_PARTITION 0xa5 -#define NETBSD_PARTITION 0xa9 #define DKTYPENAMES #include "fdiskbsdlabel.h" #include "all-io.h" @@ -127,21 +125,6 @@ osf_probe_label(struct fdisk_context *cxt) return 1; } -#if !defined (__alpha__) -static int hidden(int type) -{ - return type ^ 0x10; -} - -static int is_bsd_partition_type(int type) -{ - return (type == FREEBSD_PARTITION || - type == hidden(FREEBSD_PARTITION) || - type == NETBSD_PARTITION || - type == hidden(NETBSD_PARTITION)); -} -#endif - static int xbsd_write_disklabel (struct fdisk_context *cxt) { printf (_("Writing disklabel to %s.\n"), cxt->dev_path); @@ -275,6 +258,20 @@ static int xbsd_create_disklabel(struct fdisk_context *cxt) return rc; } +#if !defined (__alpha__) +#define HIDDEN_MASK 0x10 + +static int is_bsd_partition_type(int type) +{ + return (type == MBR_FREEBSD_PARTITION || + type == (MBR_FREEBSD_PARTITION ^ HIDDEN_MASK) || + type == MBR_NETBSD_PARTITION || + type == (MBR_NETBSD_PARTITION ^ HIDDEN_MASK) || + type == MBR_OPENBSD_PARTITION || + type == (MBR_OPENBSD_PARTITION ^ HIDDEN_MASK)); +} +#endif + void bsd_command_prompt (struct fdisk_context *cxt) {