Skip to content

Commit

Permalink
Add error handling on realpath() call.
Browse files Browse the repository at this point in the history
(Without this, it happened for me that realpath() failed returning
undef for the default vardir. This in turn caused mysql-test-run.pl to
delete the source mysql-test/ directory.)
  • Loading branch information
knielsen committed Feb 7, 2015
1 parent 2deaa29 commit 734c4c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,12 @@ sub command_line_setup {
{
$default_vardir= "$glob_mysql_test_dir/var";
}
$default_vardir = realpath $default_vardir unless IS_WINDOWS;
unless (IS_WINDOWS) {
my $realpath = realpath($default_vardir);
die "realpath('$default_vardir') failed: $!\n"
unless defined($realpath) && $realpath ne '';
$default_vardir = $realpath;
}

if ( ! $opt_vardir )
{
Expand Down

0 comments on commit 734c4c0

Please sign in to comment.