From 755e511024f29df150d9d150d19c849e59c1e216 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 2 Jul 1999 09:25:48 +0000 Subject: *** empty log message *** --- perl-install/fsedit.pm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'perl-install/fsedit.pm') diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index ecc13a79f..8687d694c 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -155,27 +155,28 @@ sub removeFromList($$$) { sub allocatePartitions($$) { my ($hds, $to_add) = @_; my %free_sectors = map { $_->{device} => [1, $_->{totalsectors} ] } @$hds; # first sector is always occupied by the MBR - my $remove = sub { removeFromList($_->{start}, $_->{start} + $_->{size}, $free_sectors{$_->{rootDevice}}) }; + my $remove = sub { removeFromList($_[0]->{start}, $_[0]->{start} + $_[0]->{size}, $free_sectors{$_[0]->{rootDevice}}) }; my $success = 0; - foreach (get_fstab(@$hds)) { &$remove(); } + foreach (get_fstab(@$hds)) { &$remove($_); } FSTAB: foreach (@$to_add) { + my %e = %$_; foreach my $hd (@$hds) { my $v = $free_sectors{$hd->{device}}; for (my $i = 0; $i < @$v; $i += 2) { my $size = $v->[$i + 1] - $v->[$i]; - $_->{size} > $size and next; - $_->{start} = $v->[$i]; - $_->{rootDevice} = $hd->{device}; - partition_table::adjustStartAndEnd($hd, $_); - &$remove(); - partition_table::add($hd, $_); + $e{size} > $size and next; + $e{start} = $v->[$i]; + $e{rootDevice} = $hd->{device}; + partition_table::adjustStartAndEnd($hd, \%e); + &$remove(\%e); + partition_table::add($hd, \%e); $success++; next FSTAB; } } - log::ld("can't allocate partition $_->{mntpoint} of size $_->{size}, not enough room"); + log::ld("can't allocate partition $e{mntpoint} of size $e{size}, not enough room"); } $success; } -- cgit v1.2.1