[PATCH] honor DM_DEV_DIR envvar

=3D?utf-8?q?Guido=3D20G=3DC3=3DBCnther?=3D agx at sigxcpu.org
Thu Jun 5 11:36:17 UTC 2008


* libparted/arch/linux.c (_dm_maptype): Make libparted handle $DM_DEV_DIR
the same way dmsetup does.
---
 libparted/arch/linux.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 4533ba3..e1b6b64 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -310,6 +310,10 @@ _dm_maptype (PedDevice *dev)
         char *target_type =3D NULL;
         char *params;
         int r =3D -1;
+        const char* dev_dir =3D getenv ("DM_DEV_DIR");
+
+        if (dev_dir && *dev_dir && !dm_set_dev_dir(dev_dir))
+                return r;

         if (!(dmt =3D dm_task_create(DM_DEVICE_TABLE)))
                 return r;
--=20
1.5.6.rc0.30.g7c3f3




More information about the parted-devel mailing list