1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge 10.11 into 11.0

This commit is contained in:
Marko Mäkelä
2023-06-08 13:49:48 +03:00
140 changed files with 3872 additions and 1725 deletions

View File

@@ -34,7 +34,7 @@ use strict;
use Exporter;
use base "Exporter";
our @EXPORT= qw /rmtree mkpath copytree/;
our @EXPORT= qw /rmtree mkpath copytree make_readonly/;
use File::Find;
use File::Copy;
@@ -184,6 +184,10 @@ sub copytree {
# Only copy plain files
next unless -f "$from_dir/$_";
copy("$from_dir/$_", "$to_dir/$_");
if (!$use_umask)
{
chmod(0666, "$to_dir/$_");
}
}
closedir(DIR);
@@ -193,4 +197,29 @@ sub copytree {
}
}
sub make_readonly {
my ($dir) = @_;
die "Usage: make_readonly(<dir>])"
unless @_ == 1;
opendir(DIR, "$dir")
or croak("Can't find $dir$!");
for(readdir(DIR)) {
next if "$_" eq "." or "$_" eq "..";
if ( -d "$dir/$_" )
{
make_readonly("$dir/$_");
next;
}
# Only copy plain files
next unless -f "$dir/$_";
chmod 0444, "$dir/$_";
}
closedir(DIR);
}
1;

View File

@@ -40,7 +40,7 @@ our @EXPORT= qw(create_process);
# Retry a couple of times if fork returns EAGAIN
#
sub _safe_fork {
my $retries= 5;
my $retries= 100;
my $pid;
FORK: