Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
2ef4d0a2
Commit
2ef4d0a2
authored
May 05, 2008
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change rmtree+mkpath to use clean_dir
parent
1a49ec06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+26
-4
No files found.
mysql-test/mysql-test-run.pl
View file @
2ef4d0a2
...
...
@@ -3161,6 +3161,30 @@ sub check_expected_crash_and_restart {
}
# Remove all files and subdirectories of a directory
sub
clean_dir
{
my
(
$dir
)
=
@_
;
finddepth
(
{
no_chdir
=>
1
,
wanted
=>
sub
{
if
(
-
d
$_
){
# A dir
if
(
$_
eq
$dir
){
# The dir to clean
return
;
}
else
{
rmdir
(
$_
)
or
mtr_warning
("
rmdir failed: $!
");
}
}
else
{
# Hopefully a file
unlink
(
$_
)
or
mtr_warning
("
unlink failed: $!
");
}
}
},
$dir
);
}
sub
clean_datadir
{
mtr_verbose
("
Cleaning datadirs...
");
...
...
@@ -3183,11 +3207,9 @@ sub clean_datadir {
}
# Remove all files in tmp and var/tmp
rmtree
("
$opt_vardir
/tmp
");
mkpath
("
$opt_vardir
/tmp
");
clean_dir
("
$opt_vardir
/tmp
");
if
(
$opt_tmpdir
ne
"
$opt_vardir
/tmp
"){
rmtree
(
$opt_tmpdir
);
mkpath
(
$opt_tmpdir
);
clean_dir
(
$opt_tmpdir
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment