summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch')
-rw-r--r--meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch76
1 files changed, 50 insertions, 26 deletions
diff --git a/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch b/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
index 68ab715f32..8c4d2ae66d 100644
--- a/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
+++ b/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
@@ -1,44 +1,68 @@
-From 060e74354774d36d2c11ef08e3e7ea9b9b6e23fb Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Thu, 13 Nov 2014 11:29:33 +0800
-Subject: [PATCH] libparted/arch/linux.c: fix compile failure while
- --disable-device-mapper
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
-While --disable-device-mapper, the MACRO ENABLE_DEVICE_MAPPER is
-undef, but it missed to scope some device mapper functions.
+From da3f129710929abe9a403901fa7d168355b0e95a Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sun, 3 May 2015 10:33:15 +0200
+Subject: [PATCH] libparted/arch/linux.c: Compile without ENABLE_DEVICE_MAPPER
-Upstream-Status: Pending
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Brian C. Lane <bcl@redhat.com>
---
- libparted/arch/linux.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
+ libparted/arch/linux.c | 21 +++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
-index 6fd73c5..2afa479 100644
+index a15854f..7f12f58 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
-@@ -2320,6 +2320,7 @@ zasprintf (const char *format, ...)
+@@ -2305,6 +2305,7 @@ zasprintf (const char *format, ...)
+ return r < 0 ? NULL : resultp;
+ }
+
++#ifdef ENABLE_DEVICE_MAPPER
static char *
dm_canonical_path (PedDevice const *dev)
{
-+#ifdef ENABLE_DEVICE_MAPPER
- LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev);
-
- /* Get map name from devicemapper */
-@@ -2337,6 +2338,7 @@ dm_canonical_path (PedDevice const *dev)
- dm_task_destroy (task);
- return dev_name;
+@@ -2327,14 +2328,21 @@ dm_canonical_path (PedDevice const *dev)
err:
-+#endif
return NULL;
}
++#endif
+
+ static char*
+ _device_get_part_path (PedDevice const *dev, int num)
+ {
+- char *devpath = (dev->type == PED_DEVICE_DM
+- ? dm_canonical_path (dev) : dev->path);
+- size_t path_len = strlen (devpath);
++ char *devpath;
++ size_t path_len;
+ char *result;
++#ifdef ENABLE_DEVICE_MAPPER
++ devpath = (dev->type == PED_DEVICE_DM
++ ? dm_canonical_path (dev) : dev->path);
++#else
++ devpath = dev->path;
++#endif
++ path_len = strlen (devpath);
+ /* Check for devfs-style /disc => /partN transformation
+ unconditionally; the system might be using udev with devfs rules,
+ and if not the test is harmless. */
+@@ -2350,8 +2358,10 @@ _device_get_part_path (PedDevice const *dev, int num)
+ ? "p" : "");
+ result = zasprintf ("%s%s%d", devpath, p, num);
+ }
++#ifdef ENABLE_DEVICE_MAPPER
+ if (dev->type == PED_DEVICE_DM)
+ free (devpath);
++#endif
+ return result;
+ }
-@@ -2957,13 +2959,15 @@ _disk_sync_part_table (PedDisk* disk)
- unsigned long long *start,
+@@ -2946,12 +2956,15 @@ _disk_sync_part_table (PedDisk* disk)
unsigned long long *length);
--
+
+#ifdef ENABLE_DEVICE_MAPPER
if (disk->dev->type == PED_DEVICE_DM) {
add_partition = _dm_add_partition;
@@ -53,5 +77,5 @@ index 6fd73c5..2afa479 100644
remove_partition = _blkpg_remove_partition;
#ifdef BLKPG_RESIZE_PARTITION
--
-1.9.1
+2.11.0