From 99cef18d69e82a64dc86943f8540251b1e5a36e4 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Fri, 2 Feb 2024 11:21:25 +0100 Subject: [PATCH] [backend] BSContar: allow to pass a filehandle to compress_entry The file must have been opened both for reading and writing. --- src/backend/BSContar.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/BSContar.pm b/src/backend/BSContar.pm index e8ac7e58112..ce3d385c8fa 100644 --- a/src/backend/BSContar.pm +++ b/src/backend/BSContar.pm @@ -99,6 +99,8 @@ sub compress_entry { my $tmp; if (!defined($outfile)) { open($tmp, '+>', undef) || die("tmp file open: $!\n"); + } elsif (ref($outfile)) { + $tmp = $outfile; } else { open($tmp, '+>', $outfile) || die("$outfile: $!\n"); }