[gparted] Enhance get_dmraid_name to also check udev information if needed
- From: Curtis Gedak <gedakc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gparted] Enhance get_dmraid_name to also check udev information if needed
- Date: Tue, 28 Apr 2009 16:30:27 -0400 (EDT)
commit 58c9336e9d912b832caaa8d8859542f5501a3447
Author: Curtis Gedak <gedakc gmail com>
Date: Tue Apr 28 14:21:56 2009 -0600
Enhance get_dmraid_name to also check udev information if needed
---
src/DMRaid.cc | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/src/DMRaid.cc b/src/DMRaid.cc
index 5f5943d..a05a84c 100644
--- a/src/DMRaid.cc
+++ b/src/DMRaid.cc
@@ -162,7 +162,17 @@ Glib::ustring DMRaid::get_dmraid_name( const Glib::ustring & dev_path )
if ( Utils::regexp_label( dev_path, regexp ) == dmraid_devices[k] )
dmraid_name = dmraid_devices[k] ;
}
-
+
+ //Some distros appear to default to /dev/dm-# for device names, so
+ // also check with udev for dmraid name
+ if ( dmraid_name .empty() && ( dev_path .find( "/dev/dm" ) != Glib::ustring::npos ) )
+ {
+ Glib::ustring udev_name = get_udev_name( dev_path ) ;
+ for ( unsigned int k=0; k < dmraid_devices .size(); k++ )
+ if ( udev_name .find( dmraid_devices[k] ) != Glib::ustring::npos )
+ dmraid_name = dmraid_devices[k] ;
+ }
+
return dmraid_name ;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]