summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 {