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:05 +0000 (07:18 -0500)
per gripe from Andres Freund and Tom Lane

Backpatch to all live branches.

src/test/perl/PostgresNode.pm

index e457f84fd02c0fe3e937808ccf7bb6f0972d1d29..b7e4dbd0e8e4426d483c1b4fd517c82ee99e4040 100644 (file)
@@ -1320,7 +1320,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)
    {