From c21f6d2d213e2abb698c1add1d1aba7549ab2de6 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 27 Aug 2002 22:04:03 +0000 Subject: - do not handle clearall in read() - ensure not partition table in written when "readonly" (it must not happen, but just in case) --- perl-install/partition_table.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 7efc3a45d..8ed9716a0 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -485,12 +485,8 @@ sub read_one($$) { { raw => $pt, extended => $extended[0], normal => \@normal, info => $info }; } -sub read($;$) { - my ($hd, $clearall) = @_; - if ($clearall) { - partition_table::raw::zero_MBR_and_dirty($hd); - return 1; - } +sub read { + my ($hd) = @_; my $pt = read_one($hd, 0) or return 0; $hd->{primary} = $pt; undef $hd->{extended}; @@ -554,6 +550,7 @@ sub read_extended { sub write { my ($hd) = @_; $hd->{isDirty} or return; + $hd->{readonly} and die "a read-only partition table should not be dirty!"; #- set first primary partition active if no primary partitions are marked as active. if (my @l = @{$hd->{primary}{raw}}) { -- cgit v1.2.1