From f4ec72a8fcc07099380ad0ec10ad2df05160bcfb Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 19 Oct 2001 16:19:19 +0000 Subject: handle empty $hd->{primary}{raw} (happens with no partitions on ia64) --- perl-install/partition_table.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 350431870..ee1769ad9 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -525,8 +525,12 @@ sub write { $hd->{isDirty} or return; #- set first primary partition active if no primary partitions are marked as active. - for ($hd->{primary}{raw}) { - (grep { $_->{local_start} = $_->{start}; $_->{active} ||= 0 } @$_) or $_->[0]{active} = 0x80; + if (my @l = @{$hd->{primary}{raw}}) { + foreach (@l) { + $_->{local_start} = $_->{start}; + $_->{active} ||= 0; + } + $l[0]{active} = 0x80 if !grep { $_->{active} } @l; } #- last chance for verification, this make sure if an error is detected, -- cgit v1.2.1