summaryrefslogtreecommitdiffstats
path: root/perl-install/devices.pm
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/devices.pm
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/devices.pm')
-rw-r--r--perl-install/devices.pm10
1 files changed, 6 insertions, 4 deletions
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) {