From 5b1c2dd1db6465f4664becc9a8b686e4151fae68 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Tue, 17 Aug 2021 21:16:41 +0200 Subject: tests/*server.pl: flush output before executing subprocess Also avoid shell processes staying around by using exec. This is necessary to avoid output data being buffering inside the process chain of Perl, Bash/Shell and our test server binaries. On non-Windows systems the exec will also make the subprocess replace the intermediate shell, but on Windows it will at least bind the processes together since there is no real fork or exec available. See: https://cygwin.com/cygwin-ug-net/highlights.html and: https://docs.microsoft.com/cpp/c-runtime-library/exec-wexec-functions Ref: https://github.com/curl/curl/pull/7530#issuecomment-900949010 Reviewed-by: Daniel Stenberg Reviewed-by: Jay Satiro Closes #7530 --- tests/tftpserver.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/tftpserver.pl') diff --git a/tests/tftpserver.pl b/tests/tftpserver.pl index f9fbbe9bc..d582b5fb6 100755 --- a/tests/tftpserver.pl +++ b/tests/tftpserver.pl @@ -120,4 +120,5 @@ $flags .= "--pidfile \"$pidfile\" ". "--logfile \"$logfile\" "; $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\""; -exec("server/tftpd".exe_ext('SRV')." $flags"); +$| = 1; +exec("exec server/tftpd".exe_ext('SRV')." $flags"); -- cgit v1.2.1