summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-29 12:25:51 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-29 12:25:51 +0000
commitedde4114b1aa035443271f52e87c1b71530b7401 (patch)
treeb5ebf0acc3a3bb6a4a049c27142b434870a24256
parent3b8ff8daaaa524813ef41de7f15be13fab5759b1 (diff)
downloaddrakx-backup-do-not-use-edde4114b1aa035443271f52e87c1b71530b7401.tar
drakx-backup-do-not-use-edde4114b1aa035443271f52e87c1b71530b7401.tar.gz
drakx-backup-do-not-use-edde4114b1aa035443271f52e87c1b71530b7401.tar.bz2
drakx-backup-do-not-use-edde4114b1aa035443271f52e87c1b71530b7401.tar.xz
drakx-backup-do-not-use-edde4114b1aa035443271f52e87c1b71530b7401.zip
dumpe2fs call cleanup
-rw-r--r--perl-install/diskdrake/interactive.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 4406775db..f53e00d58 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -642,17 +642,16 @@ sub Resize {
$max = min($max, $nice_resize{fat}->max_size);
} elsif (isExt2($part) || isThisFs('ext3', $part)) {
write_partitions($in, $hd) or return;
- $nice_resize{ext2} = devices::make($part->{device});
- my $r = `dumpe2fs $nice_resize{ext2} 2>/dev/null`;
+ my $dev = devices::make($part->{device});
+ my $r = run_program::get_stdout('dumpe2fs', $dev);
$r =~ /Block count:\s*(\d+)/ and $block_count = $1;
$r =~ /Free blocks:\s*(\d+)/ and $free_block = $1;
$r =~ /Block size:\s*(\d+)/ and $block_size = $1;
log::l("dumpe2fs $nice_resize{ext2} gives: Block_count=$block_count, Free_blocks=$free_block, Block_size=$block_size");
if ($block_count && $free_block && $block_size) {
- $min = max($min, ($block_count - $free_block) * $block_size / 512);
- $max = min($max, $block_count * $block_size / 512);
- } else {
- delete $nice_resize{ext2};
+ $min = max($min, ($block_count - $free_block) * ($block_size / 512));
+ $max = min($max, $block_count * ($block_size / 512));
+ $nice_resize{ext2} = $dev;
}
} elsif (isThisFs('ntfs', $part)) {
write_partitions($in, $hd) or return;