From 49f71c5c970e51a8918b3624e4f41d99751b4a2a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 19 Apr 2007 14:51:46 +0000 Subject: r22374: fix perl warnings metze (This used to be commit e8dd140a03eb8ee5f444551a05d313864801c50e) --- source4/script/tests/SocketWrapper.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source4/script') diff --git a/source4/script/tests/SocketWrapper.pm b/source4/script/tests/SocketWrapper.pm index 17c4457146..aa913d240e 100644 --- a/source4/script/tests/SocketWrapper.pm +++ b/source4/script/tests/SocketWrapper.pm @@ -35,8 +35,18 @@ sub setup_dir($$) } } - $ENV{SOCKET_WRAPPER_PCAP_DIR} = $pcap_dir; - $ENV{SOCKET_WRAPPER_DIR} = $dir; + if (defined($pcap_dir)) { + $ENV{SOCKET_WRAPPER_PCAP_DIR} = $pcap_dir; + } else { + delete $ENV{SOCKET_WRAPPER_PCAP_DIR}; + } + + if (defined($dir)) { + $ENV{SOCKET_WRAPPER_DIR} = $dir; + } else { + delete $ENV{SOCKET_WRAPPER_DIR}; + } + return $dir; } -- cgit