summaryrefslogtreecommitdiff
path: root/source4/script/tests/SocketWrapper.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/script/tests/SocketWrapper.pm')
-rw-r--r--source4/script/tests/SocketWrapper.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/script/tests/SocketWrapper.pm b/source4/script/tests/SocketWrapper.pm
index c9edbcdf3d..d01aba829e 100644
--- a/source4/script/tests/SocketWrapper.pm
+++ b/source4/script/tests/SocketWrapper.pm
@@ -15,6 +15,14 @@ use FindBin qw($RealBin);
sub setup_dir($)
{
my ($dir) = @_;
+ if (defined($dir)) {
+ if ( -d $dir ) {
+ unlink <$dir/*>;
+ } else {
+ mkdir($dir);
+ }
+ }
+
$ENV{SOCKET_WRAPPER_DIR} = $dir;
return $dir;
}