[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH parted 2/2] libparted: Don't canonicalize /dev/mapper paths

From: Hans de Goede
Subject: [PATCH parted 2/2] libparted: Don't canonicalize /dev/mapper paths
Date: Tue, 6 Apr 2010 15:57:18 +0200

Besides fixing the issue displayed by libparted/tests/symlink.c,
this has the added advantage that the output of parted p on one of these
devices now says:
"Disk /dev/mapper/BigVol2-lv_iscsi_disk2: 34.4GB"

Which is a lot more user friendly then the output before this patch:
"Disk /dev/dm-6: 34.4GB"

* libparted/device.c: Don't canonicalize /dev/mapper paths
 libparted/device.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libparted/device.c b/libparted/device.c
index 0f36a03..64da978 100644
--- a/libparted/device.c
+++ b/libparted/device.c
@@ -139,10 +139,12 @@ PedDevice*
 ped_device_get (const char* path)
        PedDevice*      walk;
-       char*           normal_path;
+       char*           normal_path = NULL;
        PED_ASSERT (path != NULL, return NULL);
-       normal_path = canonicalize_file_name (path);
+       /* Don't canonicalize /dev/mapper paths, see tests/symlink.c */
+       if (strncmp (path, "/dev/mapper/", 12))
+               normal_path = canonicalize_file_name (path);
        if (!normal_path)
                /* Well, maybe it is just that the file does not exist.
                 * Try it anyway.  */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]