From 55c0c2fd25ebbb6930d68289a1528e06d8a3f52e Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Fri, 13 Apr 2018 16:57:05 +0200 Subject: [PATCH] TT#35426 get_fax(): fix fax data print into a closed filehandle * in case of a specified fax format (pdf) the temp filehandle had been closed before filled in with data Change-Id: I938cfa47051a525069902f73b83de121838c00bb (cherry picked from commit 794b178dd17a0695ca60ba1bd35dc72bf73ee9d8) --- lib/NGCP/Panel/Utils/Fax.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Utils/Fax.pm b/lib/NGCP/Panel/Utils/Fax.pm index 69fc9403a4..751ed37a5b 100644 --- a/lib/NGCP/Panel/Utils/Fax.pm +++ b/lib/NGCP/Panel/Utils/Fax.pm @@ -124,8 +124,8 @@ sub get_fax { File::Temp::tempfile( DIR => $cfg->{spool_dir}."/tmp") or $self->error("Cannot create temp file: $ERRNO"); binmode $tmp_fh; - close $tmp_fh; print $tmp_fh $item->voip_fax_data->data; + close $tmp_fh; } else { return ($item->voip_fax_data->data, $ext); }