Fix perl warning from commit 9b4eafcaf4
authorAndrew Dunstan <[email protected]>
Wed, 23 Nov 2022 12:17:26 +0000 (07:17 -0500)
committerAndrew Dunstan <[email protected]>
Wed, 23 Nov 2022 12:18:16 +0000 (07:18 -0500)
per gripe from Andres Freund and Tom Lane

Backpatch to all live branches.

src/test/perl/PostgresNode.pm

index 506d39a3c33eb2605c7af9a6126b13b51f43dcc0..ef5d3bb9e10f53cd626e9b86d8600a1d47d52629 100644 (file)
@@ -1243,7 +1243,7 @@ sub _reserve_port
    # take an exclusive lock to avoid concurrent access
    flock($portfile, LOCK_EX) || die "locking port file $filename: $!";
    # see if someone else has or had a reservation of this port
-   my $pid = <$portfile>;
+   my $pid = <$portfile> || "0";
    chomp $pid;
    if ($pid +0 > 0)
    {