From ad8edae312e2d3676ac2e2b5ef76b8ba8d20f940 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 27 Nov 2001 16:42:14 +0000 Subject: (generate_guid): cleanup --- perl-install/partition_table_gpt.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'perl-install') 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 { -- cgit v1.2.1