From 3ba4a53a0fae7b6135ee9b8cd0ab4bbe352b4bdc Mon Sep 17 00:00:00 2001 From: djk Date: Mon, 24 May 1999 11:33:19 +0000 Subject: [PATCH] tried to get rid of some of the annoying global destructions messages on end of program --- perl/DXCluster.pm | 10 +++++----- perl/DXLog.pm | 10 ++++------ perl/Msg.pm | 1 + perl/client.pl | 3 ++- perl/cluster.pl | 4 +++- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/perl/DXCluster.pm b/perl/DXCluster.pm index 021ff7f2..c0ec375a 100644 --- a/perl/DXCluster.pm +++ b/perl/DXCluster.pm @@ -136,11 +136,11 @@ sub cluster return " $DXNode::nodes nodes, $users local / $tot total users Max users $DXNode::maxusers Uptime $uptime"; } -sub DESTROY -{ - my $self = shift; - dbg('cluster', "destroying $self->{call}\n"); -} +#sub DESTROY +#{ +# my $self = shift; +# dbg('cluster', "destroying $self->{call}\n"); +#} no strict; sub AUTOLOAD diff --git a/perl/DXLog.pm b/perl/DXLog.pm index 2dc6d2fe..8e2fc66f 100644 --- a/perl/DXLog.pm +++ b/perl/DXLog.pm @@ -27,7 +27,7 @@ package DXLog; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(Log); +@EXPORT = qw(Log Logclose); use FileHandle; use DXVars; @@ -174,10 +174,8 @@ sub Log $log->writeunix($t, join('^', $t, @_) ); } -sub DESTROY # catch undefs and do what is required further down the tree +sub Logclose { - my $self = shift; -# DXDebug::dbg("dxlog", "closing $self->{fn}\n"); - undef $self->{fh} if defined $self->{fh}; -} + $log->close(); +} 1; diff --git a/perl/Msg.pm b/perl/Msg.pm index 65a32a66..aaa38b53 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -68,6 +68,7 @@ sub disconnect { return unless defined($sock); set_event_handler ($sock, "read" => undef, "write" => undef); shutdown($sock, 3); + close($sock); } sub send_now { diff --git a/perl/client.pl b/perl/client.pl index c6f5bd28..850b81d6 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -45,7 +45,7 @@ use IO::File; use IO::Socket; use IPC::Open2; use Net::Telnet qw(TELOPT_ECHO); -use Carp; +use Carp qw{cluck}; # cease communications sub cease @@ -60,6 +60,7 @@ sub cease kill(9, $pid); } dbgclose(); +# $SIG{__WARN__} = sub {my $a = shift; cluck($a); }; sleep(1); exit(0); } diff --git a/perl/cluster.pl b/perl/cluster.pl index b471c754..a0703537 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -61,7 +61,7 @@ use Filter; use Local; use Fcntl ':flock'; -use Carp; +use Carp qw(cluck); package main; @@ -194,7 +194,9 @@ sub cease dbg('chan', "DXSpider version $version ended"); Log('cluster', "DXSpider V$version stopped"); dbgclose(); + Logclose(); unlink $lockfn; +# $SIG{__WARN__} = $SIG{__DIE__} = sub {my $a = shift; cluck($a); }; exit(0); } -- 2.43.0