summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-11-27 16:42:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-11-27 16:42:14 +0000
commitad8edae312e2d3676ac2e2b5ef76b8ba8d20f940 (patch)
treef7f1c9ff15808e324c6682cf6eba2c8f40ad3978
parentc0414cb19883c3ce6f0e6ae2b8cf0e1f24d2c7e8 (diff)
downloaddrakx-backup-do-not-use-ad8edae312e2d3676ac2e2b5ef76b8ba8d20f940.tar
drakx-backup-do-not-use-ad8edae312e2d3676ac2e2b5ef76b8ba8d20f940.tar.gz
drakx-backup-do-not-use-ad8edae312e2d3676ac2e2b5ef76b8ba8d20f940.tar.bz2
drakx-backup-do-not-use-ad8edae312e2d3676ac2e2b5ef76b8ba8d20f940.tar.xz
drakx-backup-do-not-use-ad8edae312e2d3676ac2e2b5ef76b8ba8d20f940.zip
(generate_guid): cleanup
-rw-r--r--perl-install/partition_table_gpt.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/perl-install/partition_table_gpt.pm b/perl-install/partition_table_gpt.pm
index 4a0514d8e..fe70009b0 100644
--- a/perl-install/partition_table_gpt.pm
+++ b/perl-install/partition_table_gpt.pm
@@ -64,15 +64,15 @@ $_ = join('', @$_) foreach $main_format, $partitionEntry_format, $guid_format;
my $magic = "EFI PART";
sub generate_guid {
- local *F;
- open F, devices::make("random") or die "Could not open /dev/random for GUID generation";
- read F, $tmp, psizeof($guid_format);
- close F;
+ my $tmp;
+ local *F;
+ open F, devices::make("random") or die "Could not open /dev/random for GUID generation";
+ read F, $tmp, psizeof($guid_format);
- my %guid; @guid{@$guid_fields} = unpack $guid_format, $tmp;
- $guid{clock_seq} = ($guid{clock_seq} & 0x3fff) | 0x8000;
- $guid{time_hi_and_version} = ($guid{time_hi_and_version} & 0x0fff) | 0x4000;
- pack($guid_format, @guid{@$guid_fields});
+ my %guid; @guid{@$guid_fields} = unpack $guid_format, $tmp;
+ $guid{clock_seq} = ($guid{clock_seq} & 0x3fff) | 0x8000;
+ $guid{time_hi_and_version} = ($guid{time_hi_and_version} & 0x0fff) | 0x4000;
+ pack($guid_format, @guid{@$guid_fields});
}
sub crc32 {