From 5ff2fd1ff97212e4e490107d69f25572b71d2409 Mon Sep 17 00:00:00 2001 From: djk Date: Mon, 24 May 1999 10:46:44 +0000 Subject: [PATCH] attempt to get rid of some of the useless messages on program exit --- perl/DXDebug.pm | 10 ++++++++-- perl/DXLog.pm | 2 +- perl/client.pl | 3 ++- perl/cluster.pl | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/perl/DXDebug.pm b/perl/DXDebug.pm index 64ed8439..c44ba359 100644 --- a/perl/DXDebug.pm +++ b/perl/DXDebug.pm @@ -11,8 +11,8 @@ package DXDebug; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(dbg dbgadd dbgsub dbglist isdbg); -@EXPORT_OK = qw(dbg dbgadd dbgsub dbglist isdbg); +@EXPORT = qw(dbg dbgadd dbgsub dbglist isdbg dbgclose); +@EXPORT_OK = qw(dbg dbgadd dbgsub dbglist isdbg dbgclose); use strict; use vars qw(%dbglevel $fp); @@ -36,6 +36,12 @@ if (!defined $DB::VERSION) { }; } +sub dbgclose +{ + $SIG{__DIE__} = $SIG{__WARN__} = 'DEFAULT'; + $fp->close(); +} + sub dbg { my $l = shift; diff --git a/perl/DXLog.pm b/perl/DXLog.pm index 8cc6f850..2dc6d2fe 100644 --- a/perl/DXLog.pm +++ b/perl/DXLog.pm @@ -177,7 +177,7 @@ sub Log sub DESTROY # catch undefs and do what is required further down the tree { my $self = shift; - DXDebug::dbg("dxlog", "closing $self->{fn}\n"); +# DXDebug::dbg("dxlog", "closing $self->{fn}\n"); undef $self->{fh} if defined $self->{fh}; } 1; diff --git a/perl/client.pl b/perl/client.pl index 4a4069f0..c6f5bd28 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # # A thing that implements dxcluster 'protocol' # @@ -59,6 +59,7 @@ sub cease dbg('connect', "killing $pid"); kill(9, $pid); } + dbgclose(); sleep(1); exit(0); } diff --git a/perl/cluster.pl b/perl/cluster.pl index 3014e24f..b471c754 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -193,6 +193,7 @@ sub cease DXUser::finish(); dbg('chan', "DXSpider version $version ended"); Log('cluster', "DXSpider V$version stopped"); + dbgclose(); unlink $lockfn; exit(0); } -- 2.43.0