1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-32387 - prevent output during temporary changes to STDOUT/STDERR

create_process() temporarily changes STDOUT/STDERR output to error log file

This might redirect mtr output on Windows, so avoid it by holding
flush_lock.
This commit is contained in:
Vladislav Vaintroub
2024-10-28 10:45:50 +01:00
parent 284593413f
commit 4b068b7fcb
2 changed files with 5 additions and 1 deletions

View File

@ -114,6 +114,10 @@ sub create_process {
lock($win32_spawn_lock);
# STDOUT/STDERR are temporarily reassigned, avoid prevent
# output from another thread
lock($mtr_report::flush_lock);
#printf STDERR "stdin %d, stdout %d, stderr %d\n",
# fileno STDIN, fileno STDOUT, fileno STDERR;

View File

@ -88,7 +88,7 @@ sub flush_out {
}
use if $^O eq "MSWin32", "threads::shared";
my $flush_lock :shared;
our $flush_lock :shared;
# Print to stdout
sub print_out {