From: Michael Tremer Date: Thu, 16 Oct 2025 16:40:08 +0000 (+0200) Subject: general-functions.pl: Read output first before we wait for the process to terminate X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d451f131ff19cc090d78712adc9309dd5bed2990;p=ipfire-2.x.git general-functions.pl: Read output first before we wait for the process to terminate When generating IPS reports, the reporter could not write to the output, therefore blocked and the CGI script timed out. Signed-off-by: Michael Tremer --- diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 94d0e7440..1c3374d86 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -66,13 +66,13 @@ sub system_output($) { die "Could not execute @command: $!"; } - waitpid($pid, 0); - while () { push(@output, $_); } close(OUTPUT); + waitpid($pid, 0); + return @output; }