aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-01-12 14:01:44 +0000
committerYang Tse <yangsita@gmail.com>2010-01-12 14:01:44 +0000
commit82f5ffff8f183720aaee296b48cd67c4c003ece5 (patch)
tree3bcbc6cb4c2f8047c4079a136ca8e07d7b205406
parent3fd67b5f365355762f9cac282e911b936242005a (diff)
Make sockfilter kill messages look alike server ones
-rw-r--r--tests/ftp.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/ftp.pm b/tests/ftp.pm
index 3bacb6f35..0f4976c7c 100644
--- a/tests/ftp.pm
+++ b/tests/ftp.pm
@@ -25,7 +25,7 @@ use strict;
use warnings;
use serverhelp qw(
- servername_str
+ servername_id
mainsockf_pidfilename
datasockf_pidfilename
);
@@ -178,19 +178,19 @@ sub killpid {
#
sub killsockfilters {
my ($proto, $ipvnum, $idnum, $verbose) = @_;
- my $srvrname;
+ my $server;
my $pidfile;
my $pid;
return if($proto !~ /^(ftp|imap|pop3|smtp)$/);
- $srvrname = servername_str($proto, $ipvnum, $idnum) if($verbose);
+ $server = servername_id($proto, $ipvnum, $idnum) if($verbose);
- $pidfile = "./". mainsockf_pidfilename($proto, $ipvnum, $idnum);
+ $pidfile = mainsockf_pidfilename($proto, $ipvnum, $idnum);
$pid = processexists($pidfile);
if($pid > 0) {
- printf("* kill pid for %s => %d\n", "${srvrname}-CTRL", $pid)
- if($verbose);
+ printf("* kill pid for %s-%s => %d\n", $server,
+ ($proto eq 'ftp')?'ctrl':'filt', $pid) if($verbose);
kill("KILL", $pid);
waitpid($pid, 0);
}
@@ -198,11 +198,11 @@ sub killsockfilters {
return if($proto ne 'ftp');
- $pidfile = "./". datasockf_pidfilename($proto, $ipvnum, $idnum);
+ $pidfile = datasockf_pidfilename($proto, $ipvnum, $idnum);
$pid = processexists($pidfile);
if($pid > 0) {
- printf("* kill pid for %s => %d\n", "${srvrname}-DATA", $pid)
- if($verbose);
+ printf("* kill pid for %s-data => %d\n", $server,
+ $pid) if($verbose);
kill("KILL", $pid);
waitpid($pid, 0);
}