[parted-devel] [PATCH] Fix device-mapper partition path detection
Otavio Salvador
otavio at ossystems.com.br
Wed May 28 00:43:37 UTC 2008
We copy dev->path to result since it doesn't has a partition number.
---
libparted/arch/linux.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index c332cf8..2f4c368 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -1970,12 +1970,13 @@ _device_get_part_path (PedDevice* dev, int num)
/* replace /disc with /path%d */
strcpy (result, dev->path);
snprintf (result + path_len - 5, 16, "/part%d", num);
+#ifdef ENABLE_DEVICE_MAPPER
+ } else if (dev->type == PED_DEVICE_DM) {
+ strcpy(result, dev->path);
+#endif
} else if (dev->type == PED_DEVICE_DAC960
|| dev->type == PED_DEVICE_CPQARRAY
|| dev->type == PED_DEVICE_ATARAID
-#ifdef ENABLE_DEVICE_MAPPER
- || dev->type == PED_DEVICE_DM
-#endif
|| isdigit (dev->path[path_len - 1]))
snprintf (result, result_len, "%sp%d", dev->path, num);
else
--
1.5.5.1
More information about the parted-devel
mailing list