summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/context.c
diff options
context:
space:
mode:
authorKarel Zak2017-07-17 09:47:42 +0200
committerKarel Zak2017-07-17 09:47:42 +0200
commit5ecd61851115a62064dd233c870a76fc26e007d7 (patch)
treef4fa3d0a04060f9ffb3fcdd7215a14a3682c27bd /libfdisk/src/context.c
parentlibfdisk: make fdisk compliant to UEFI/GPT specification on PMBR (diff)
downloadkernel-qcow2-util-linux-5ecd61851115a62064dd233c870a76fc26e007d7.tar.gz
kernel-qcow2-util-linux-5ecd61851115a62064dd233c870a76fc26e007d7.tar.xz
kernel-qcow2-util-linux-5ecd61851115a62064dd233c870a76fc26e007d7.zip
libfdisk: use BLKPG_* ioctls on linux only
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/context.c')
-rw-r--r--libfdisk/src/context.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c
index fce740e15..54e43192e 100644
--- a/libfdisk/src/context.c
+++ b/libfdisk/src/context.c
@@ -3,7 +3,9 @@
#endif
#include "blkdev.h"
-#include "partx.h"
+#ifdef __linux__
+# include "partx.h"
+#endif
#include "loopdev.h"
#include "fdiskP.h"
@@ -759,8 +761,12 @@ static inline int add_to_partitions_array(
* partition table. The BLKPG_* ioctls are used for individual partitions. The
* advantage is that unmodified partitions maybe mounted.
*
+ * The function behavies like fdisk_reread_partition_table() on systems where
+ * are no avaialble BLKPG_* ioctls.
+ *
* Returns: <0 on error, or 0.
*/
+#ifdef __linux__
int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org)
{
struct fdisk_table *tb = NULL;
@@ -836,6 +842,12 @@ done:
fdisk_unref_table(tb);
return rc;
}
+#else
+int fdisk_reread_changes(struct fdisk_context *cxt,
+ struct fdisk_table *org __attribute__((__unused__))) {
+ return fdisk_reread_partition_table(cxt);
+}
+#endif
/**
* fdisk_device_is_used: