From: Gilles Darold Date: Thu, 13 Jun 2019 13:44:01 +0000 (+0200) Subject: Fix a case where the progress bar pipe can still be called on Windows. X-Git-Tag: v11.0~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8f53eaa010779380a4791eae3b4312a5d4a0c16;p=pgbadger Fix a case where the progress bar pipe can still be called on Windows. --- diff --git a/pgbadger b/pgbadger index e8e358e..e5ba1dd 100755 --- a/pgbadger +++ b/pgbadger @@ -1407,7 +1407,7 @@ if ($incremental && !$remote_host) } # Pipe used for progress bar in multiprocess -my $pipe; +my $pipe = undef; # Seeking to an old log position is not possible outside incremental mode if (!$last_parsed) { @@ -3284,7 +3284,7 @@ sub process_file elsif ($fmt eq 'binary') { &load_stats($lfile); - $pipe->print("$totalsize 0 0\n"); + $pipe->print("$totalsize 0 0\n") if (defined $pipe); } # Format is not CSV and in incremental mode we are not at end of the file else @@ -3665,7 +3665,7 @@ sub process_file $cursize = $totalsize; } - if (!$tmpoutfile|| not defined $pipe) + if (!$tmpoutfile || not defined $pipe) { if ($totalsize) {