From 3f2f0a6fa68a1796be612ac31b5a2505be57e671 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Mon, 10 Aug 2009 08:38:01 +0000 Subject: fix two crashes on handling devices --- perl-install/NEWS | 1 + perl-install/devices.pm | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'perl-install') 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) { -- cgit v1.2.1