]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: (bsd) use macros from pt-mbr.h
authorKarel Zak <kzak@redhat.com>
Wed, 26 Jun 2013 09:46:09 +0000 (11:46 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Sep 2013 14:47:05 +0000 (16:47 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisks/fdiskbsdlabel.c

index 01c6ca3ca23f252f9527b35536bbb9f9de701729..64d266270a08f88c2652457291d7a10d61917d01 100644 (file)
@@ -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)
 {