summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-23 16:58:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-23 16:58:54 +0000
commit4c54aeb214f29a3e2fd017a839e18440c32aa596 (patch)
tree1a246c2c06d601d3aa1840130f4b31f4c36ebf86
parent773528df8b600f7d3c2dd22f16bae7b9b316141f (diff)
downloaddrakx-4c54aeb214f29a3e2fd017a839e18440c32aa596.tar
drakx-4c54aeb214f29a3e2fd017a839e18440c32aa596.tar.gz
drakx-4c54aeb214f29a3e2fd017a839e18440c32aa596.tar.bz2
drakx-4c54aeb214f29a3e2fd017a839e18440c32aa596.tar.xz
drakx-4c54aeb214f29a3e2fd017a839e18440c32aa596.zip
handle MBR containing the same character (0 or "l")
-rw-r--r--perl-install/partition_table_empty.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/perl-install/partition_table_empty.pm b/perl-install/partition_table_empty.pm
index d460317f5..b2cc545de 100644
--- a/perl-install/partition_table_empty.pm
+++ b/perl-install/partition_table_empty.pm
@@ -21,14 +21,12 @@ sub read($$) {
my ($hd, $sector) = @_;
my $tmp;
- my $magic = "\0" x 512;
-
local *F; partition_table_raw::openit($hd, *F) or die "failed to open device";
c::lseek_sector(fileno(F), $sector, 0) or die "reading of partition in sector $sector failed";
#- check magic number
- sysread F, $tmp, length $magic or die "error reading magic number";
- $tmp eq $magic or die "bad magic number";
+ sysread F, $tmp, 512 or die "error reading magic number";
+ $tmp eq substr($tmp, 0, 1) x 512 or die "bad magic number";
partition_table_raw::zero_MBR($hd);