From 4174c685952de7ae3772d936579051293ab38c85 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Mon, 15 Sep 2008 16:27:12 +0200 Subject: [PATCH] WL#4189 Wrap the check for socket path length in eval --- mysql-test/lib/My/Platform.pm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm index cee0c8778fe..507a9453f91 100644 --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm @@ -102,14 +102,22 @@ sub check_socket_path_length { require IO::Socket::UNIX; - my $sock = new IO::Socket::UNIX - ( - Local => $path, - Listen => 1, - ); + my $sock; + eval { + $sock= new IO::Socket::UNIX + ( + Local => $path, + Listen => 1, + ); + }; + if ($@) + { + print $@, '\n'; + return 2; + } if (!defined $sock){ # Could not create a UNIX domain socket - return 0; # Ok, will not be used by mysqld either + return 3; } if ($path ne $sock->hostpath()){ # Path was truncated