X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate%2FLaTeX.pm;h=352f793e12fc25d6aa81a2a399efc06eebed7a36;hb=31e6d33a8e4ec4cf11a25ad63696948bc55f63bc;hp=6ec4d96a3feb61d3b2c670080fd3595542e48dba;hpb=d56c9b0850c73bceeeadc534836c8164928cff71;p=kivitendo-erp.git diff --git a/SL/Template/LaTeX.pm b/SL/Template/LaTeX.pm index 6ec4d96a3..352f793e1 100644 --- a/SL/Template/LaTeX.pm +++ b/SL/Template/LaTeX.pm @@ -482,8 +482,10 @@ sub convert_to_postscript { $ENV{openin_any} = "p"; for (my $run = 1; $run <= 2; $run++) { - system("${latex} --interaction=nonstopmode $form->{tmpfile} " . - "> $form->{tmpfile}.err"); + if (system("${latex} --interaction=nonstopmode $form->{tmpfile} " . + "> $form->{tmpfile}.err") == -1) { + die "system call to $latex failed: $!"; + } if ($?) { $ENV{HOME} = $old_home; $ENV{openin_any} = $old_openin_any; @@ -494,12 +496,14 @@ sub convert_to_postscript { $form->{tmpfile} =~ s/tex$/dvi/; - system("dvips $form->{tmpfile} -o -q > /dev/null"); + if (system("dvips $form->{tmpfile} -o -q > /dev/null") == -1) { + die "system call to dvips failed: $!"; + } $ENV{HOME} = $old_home; $ENV{openin_any} = $old_openin_any; if ($?) { - $self->{"error"} = "dvips : $!"; + $self->{"error"} = "dvips : $?"; $self->cleanup('dvips'); return 0; } @@ -532,8 +536,11 @@ sub convert_to_pdf { $ENV{openin_any} = "p"; for (my $run = 1; $run <= 2; $run++) { - system("${latex} --interaction=nonstopmode $form->{tmpfile} " . - "> $form->{tmpfile}.err"); + if (system("${latex} --interaction=nonstopmode $form->{tmpfile} " . + "> $form->{tmpfile}.err") == -1) { + die "system call to $latex failed: $!"; + } + if ($?) { $ENV{HOME} = $old_home; $ENV{openin_any} = $old_openin_any;