[Commits] 28cfc46: Add error handling on realpath() call.

Kristian Nielsen knielsen at knielsen-hq.org
Fri Feb 6 09:35:30 EET 2015


revision-id: 28cfc46872dba676fec539c2f32b49ab37dc614e
parent(s): b08126aad1a33ec0ad3491b061e888908d1edfe5
committer: Kristian Nielsen
branch nick: server
timestamp: 2015-02-06 08:31:38 +0100
message:

Add error handling on realpath() call.

(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.)

---
 mysql-test/mysql-test-run.pl |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 3354667..47f2272 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -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 )
   {


More information about the commits mailing list