From e8dd140a03eb8ee5f444551a05d313864801c50e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 19 Apr 2007 14:51:46 +0000 Subject: [PATCH] r22374: fix perl warnings metze --- source/script/tests/SocketWrapper.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/script/tests/SocketWrapper.pm b/source/script/tests/SocketWrapper.pm index 17c44571463..aa913d240e4 100644 --- a/source/script/tests/SocketWrapper.pm +++ b/source/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; }