提交 6eda93a1 authored 作者: Mathieu Parent's avatar Mathieu Parent

email2pdf: close filehandle before passing it to the command

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@15696 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 87da13cf
...@@ -157,10 +157,10 @@ sub process_raw ...@@ -157,10 +157,10 @@ sub process_raw
my ($fh_in, $filename_in) = tempfile( DIR => $output_dir, SUFFIX => $suffix ); my ($fh_in, $filename_in) = tempfile( DIR => $output_dir, SUFFIX => $suffix );
system("chmod +r $filename_in"); system("chmod +r $filename_in");
print { $fh_in } $raw; print { $fh_in } $raw;
close $fh_in or warn $! ? "Error closing sort pipe: $!" : "Exit status $? from sort";
$command =~ s/FILE/$filename_in/; $command =~ s/FILE/$filename_in/;
print STDERR "Processing '$filename' ($content_type). From '$filename_in'. "; print STDERR "Processing '$filename' ($content_type). From '$filename_in'. ";
my $out = `$command`; my $out = `$command`;
close $fh_in or warn $! ? "Error closing sort pipe: $!" : "Exit status $? from sort";
if(!$out) { if(!$out) {
print STDERR "Empty generated PDF.\n"; print STDERR "Empty generated PDF.\n";
return; return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论