summaryrefslogtreecommitdiff
path: root/mysql-test/lib/My/Platform.pm
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2009-02-25 10:32:13 +0100
committerBjorn Munch <Bjorn.Munch@sun.com>2009-02-25 10:32:13 +0100
commite0c6aad83a364d3cc9aaa6b258bdfa31aa699e37 (patch)
tree4b5c2f3ae1825b16312a04279a91eaaa493bf64d /mysql-test/lib/My/Platform.pm
parent6bd93f670271eaf2bd79bd7fa538e9baaa7dcb0f (diff)
downloadmariadb-git-e0c6aad83a364d3cc9aaa6b258bdfa31aa699e37.tar.gz
Bug #43172 MTR leaves test files in /tmp after check_socket_path_length finds path too long
Faulty logic in cleanup Put test file into tmpdir, cleanup by removing tmpdir
Diffstat (limited to 'mysql-test/lib/My/Platform.pm')
-rw-r--r--mysql-test/lib/My/Platform.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm
index 3dd5c552b10..69ffdfbb4ce 100644
--- a/mysql-test/lib/My/Platform.pm
+++ b/mysql-test/lib/My/Platform.pm
@@ -113,8 +113,8 @@ sub check_socket_path_length {
# Create a tempfile name with same length as "path"
my $tmpdir = tempdir( CLEANUP => 0);
- my $len = length($path) - length($tmpdir);
- my $testfile = $tmpdir . "x" x ($len > 0 ? $len : 1);
+ my $len = length($path) - length($tmpdir) - 1;
+ my $testfile = $tmpdir . "/" . "x" x ($len > 0 ? $len : 1);
my $sock;
eval {
$sock= new IO::Socket::UNIX
@@ -126,17 +126,15 @@ sub check_socket_path_length {
die "Could not create UNIX domain socket: $!"
unless defined $sock;
- die "UNIX domain socket patch was truncated"
+ die "UNIX domain socket path was truncated"
unless ($testfile eq $sock->hostpath());
$truncated= 0; # Yes, it worked!
};
- #print "check_socket_path_length, failed: ", $@, '\n' if ($@);
$sock= undef; # Close socket
- unlink($testfile); # Remove the physical file
- rmdir($tmpdir); # Remove the tempdir
+ rmtree($tmpdir); # Remove the tempdir and any socket file created
return $truncated;
}