summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-08-10 08:38:01 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-08-10 08:38:01 +0000
commit3f2f0a6fa68a1796be612ac31b5a2505be57e671 (patch)
tree40c9c214876babb05373b3135e56d7b72429652f /perl-install
parent91390b32cdc677264b3c832ebbcc822bb7e0e3bc (diff)
downloaddrakx-3f2f0a6fa68a1796be612ac31b5a2505be57e671.tar
drakx-3f2f0a6fa68a1796be612ac31b5a2505be57e671.tar.gz
drakx-3f2f0a6fa68a1796be612ac31b5a2505be57e671.tar.bz2
drakx-3f2f0a6fa68a1796be612ac31b5a2505be57e671.tar.xz
drakx-3f2f0a6fa68a1796be612ac31b5a2505be57e671.zip
fix two crashes on handling devices
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS1
-rw-r--r--perl-install/devices.pm10
2 files changed, 7 insertions, 4 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 49a14c11d..062254dae 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -6,6 +6,7 @@
- do not crash when trying to create a partition on a device with
no cylinder_size
- use gtk instead of X to focus window
+- fix two crashes on handling devices
Version 12.40 - 22 July 2009
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index b6764bdd4..f94362770 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -106,9 +106,11 @@ sub entry {
"ttyS" => sub { c::S_IFCHR(), 4, 64 },
"ubd/" => sub { c::S_IFBLK(), 98, 0 },
"dm-" => sub { c::S_IFBLK(), get_dynamic_major('device-mapper'), 0 },
- }}{$prefix} or internal_error("unknown device $prefix $nb");
- ($type, $major, $minor) = $f->();
- $minor += $nb;
+ }}{$prefix};
+ if($f) {
+ ($type, $major, $minor) = $f->();
+ $minor += $nb;
+ }
}
unless ($type) {
($type, $major, $minor) =
@@ -141,7 +143,7 @@ sub entry {
"console" => [ c::S_IFCHR(), 5, 1 ],
"systty" => [ c::S_IFCHR(), 4, 0 ],
"lvm" => [ c::S_IFBLK(), 109, 0 ],
- }}{$_} };
+ }}{$_} || [] };
}
# Lookup non listed devices in /sys
unless ($type) {