From 67e22aa6ffcdebf06324d1797989cd863fb5c0f8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 12 Mar 2007 00:24:03 +0000 Subject: r21790: Setup the socket_wrapper_dir when we set the environment variable. Andrew Bartlett (This used to be commit 5c07dbd2487c5c23355ad0e3db6e9f9caf8ce145) --- source4/script/tests/Samba4.pm | 8 -------- source4/script/tests/SocketWrapper.pm | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'source4/script/tests') diff --git a/source4/script/tests/Samba4.pm b/source4/script/tests/Samba4.pm index 65b55fcee0..c4c0598ff5 100644 --- a/source4/script/tests/Samba4.pm +++ b/source4/script/tests/Samba4.pm @@ -58,14 +58,6 @@ sub smbd_check_or_start($$$$$$) warn("Not using socket wrapper, but also not running as root. Will not be able to listen on proper ports") unless defined($socket_wrapper_dir) or $< == 0; - if (defined($socket_wrapper_dir)) { - if ( -d $socket_wrapper_dir ) { - unlink <$socket_wrapper_dir/*>; - } else { - mkdir($socket_wrapper_dir); - } - } - unlink($test_fifo); POSIX::mkfifo($test_fifo, 0700); unlink($test_log); 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; } -- cgit