]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: fix non-blkid compilation
authorKarel Zak <kzak@redhat.com>
Tue, 19 Sep 2017 11:48:52 +0000 (13:48 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 19 Sep 2017 11:48:52 +0000 (13:48 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/partx.h
libfdisk/src/wipe.c

index 96206bd7c57f4b1ae361d36235ada42a51a88ca6..618a0a4983ba4a1b5051ae0cf34cbd3e20835f38 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <sys/ioctl.h>
 #include <linux/blkpg.h>
+#include <stdint.h>
 
 #ifndef BLKPG_ADD_PARTITION
 # define BLKPG_ADD_PARTITION   1
index 6173830242a000f2a34904f94d9495b0e31f27ab..ab1d7b8519d9b45d8f3f8169e9e2fb0e0cdec8f2 100644 (file)
@@ -97,9 +97,14 @@ int fdisk_set_wipe_area(struct fdisk_context *cxt,
        return 0;
 }
 
+#ifndef HAVE_LIBBLKID
+int fdisk_do_wipe(struct fdisk_context *cxt __attribute__((__unused__)))
+{
+       return 0;
+}
+#else
 int fdisk_do_wipe(struct fdisk_context *cxt)
 {
-#ifdef HAVE_LIBBLKID
        struct list_head *p;
        blkid_probe pr;
        int rc;
@@ -140,9 +145,9 @@ int fdisk_do_wipe(struct fdisk_context *cxt)
        }
 
        blkid_free_probe(pr);
-#endif
        return 0;
 }
+#endif
 
 
 /*
@@ -150,9 +155,14 @@ int fdisk_do_wipe(struct fdisk_context *cxt)
  *
  * Returns: 0 if nothing found, < 0 on error, 1 if found a signature
  */
+#ifndef HAVE_LIBBLKID
+int fdisk_check_collisions(struct fdisk_context *cxt __attribute__((__unused__)))
+{
+       return 0;
+}
+#else
 int fdisk_check_collisions(struct fdisk_context *cxt)
 {
-#ifdef HAVE_LIBBLKID
        int rc = 0;
        blkid_probe pr;
 
@@ -195,8 +205,5 @@ int fdisk_check_collisions(struct fdisk_context *cxt)
 
        blkid_free_probe(pr);
        return rc;
-#else
-       return 0;
-#endif
 }
-
+#endif