From 67580cd220d4eeeb6ac7bd8e3a11336d2de2e2af Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Sat, 20 Sep 2008 15:21:29 +0300 Subject: [PATCH] Make sure the direcory where the test socket is to be created exists --- mysql-test/lib/My/Platform.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm index 507a9453f91..630f14d957a 100644 --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm @@ -17,6 +17,8 @@ package My::Platform; use strict; +use File::Basename; +use My::File::Path; # Patched version of File::Path use base qw(Exporter); our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL @@ -104,11 +106,16 @@ sub check_socket_path_length { my $sock; eval { + # Create the directories where the + # socket till be created + mkpath(dirname($path)); + $sock= new IO::Socket::UNIX ( Local => $path, Listen => 1, ); + }; if ($@) { @@ -116,7 +123,7 @@ sub check_socket_path_length { return 2; } if (!defined $sock){ - # Could not create a UNIX domain socket + #print "Could not create UNIX domain socket: $!\n"; return 3; } if ($path ne $sock->hostpath()){