If $path does not exists the '-d' check returns undef, which then
causes "Use of uninitialized value.." warning in the log.

Signed-off-by: Thomas Lamprecht <t.lampre...@proxmox.com>
---
 PVE/Storage/Plugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index 6f72cee..18d780b 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -855,7 +855,7 @@ sub activate_storage {
 
     # this path test may hang indefinitely on unresponsive mounts
     my $timeout = 2;
-    if (! PVE::Tools::run_fork_with_timeout($timeout, sub {-d $path})) {
+    if (! PVE::Tools::run_fork_with_timeout($timeout, sub {-d $path // 0})) {
        die "unable to activate storage '$storeid' - " .
        "directory '$path' does not exist or is unreachable\n";
     }
-- 
2.11.0


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to