]> git.proxmox.com Git - pve-common.git/blobdiff - data/PVE/Tools.pm
code cleanup
[pve-common.git] / data / PVE / Tools.pm
index 647fe15fad4a1bd97c41e0e5444de988fb7694db..b222debf24ebdd2ee81808e0ecf5ed43a15e7edb 100644 (file)
@@ -19,6 +19,9 @@ use Text::ParseWords;
 use String::ShellQuote;
 use Time::HiRes qw(usleep gettimeofday tv_interval);
 
+# avoid warning when parsing long hex values with hex()
+no warnings 'portable'; # Support for 64-bit ints required
+
 our @EXPORT_OK = qw(
 $IPV6RE
 $IPV4RE
@@ -142,8 +145,7 @@ sub lock_file_full {
        $err = $@;
     }
 
-    if ($lock_handles->{$$}->{$filename}) {
-        my $fh = $lock_handles->{$$}->{$filename};
+    if (my $fh = $lock_handles->{$$}->{$filename}) {
         $lock_handles->{$$}->{$filename} = undef;
         close ($fh);
     }